public void loadUrlSync( final AwContents awContents, CallbackHelper onPageFinishedHelper, final String url, final Map<String, String> extraHeaders) throws Exception { int currentCallCount = onPageFinishedHelper.getCallCount(); loadUrlAsync(awContents, url, extraHeaders); onPageFinishedHelper.waitForCallback( currentCallCount, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS); }
public void loadUrlSyncAndExpectError( final AwContents awContents, CallbackHelper onPageFinishedHelper, CallbackHelper onReceivedErrorHelper, final String url) throws Exception { int onErrorCallCount = onReceivedErrorHelper.getCallCount(); int onFinishedCallCount = onPageFinishedHelper.getCallCount(); loadUrlAsync(awContents, url); onReceivedErrorHelper.waitForCallback( onErrorCallCount, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS); onPageFinishedHelper.waitForCallback( onFinishedCallCount, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS); }
/** Loads url on the UI thread but does not block. */ public void loadUrlAsync(final AwContents awContents, final String url) throws Exception { loadUrlAsync(awContents, url, null); }