Code example for ValueCallback

Methods: onReceiveValue

0
        try { 
            webServer = new TestWebServer(false);
            final String pageUrl = webServer.setResponse(path, html, null);
            loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageUrl);
            visitedHistoryHelper.waitForCallback(callCount);
            assertNotNull(visitedHistoryHelper.getCallback());
 
            visitedHistoryHelper.getCallback().onReceiveValue(visitedLinks);
            visitedHistoryHelper.getCallback().onReceiveValue(null);
 
            loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(), pageUrl);
        } finally { 
            if (webServer != null) webServer.shutdown();
        } 
    } 
 
    @Feature({"AndroidWebView"}) 
    @SmallTest 
    public void testGetVisitedHistoryCallbackAfterDestroy() throws Throwable { 
        GetVisitedHistoryHelper visitedHistoryHelper =
            mContentsClient.getGetVisitedHistoryHelper();