| Index: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java
|
| diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java
|
| index 9f5cc89a76743d5667ad587400c586114399f3a1..a5c1b89bbf44c623135563536fd150cf709dba5f 100644
|
| --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java
|
| +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java
|
| @@ -250,7 +250,9 @@ public class AwContentsClientShouldOverrideUrlLoadingTest extends AwTestBase {
|
| OnPageStartedHelper onPageStartedHelper = mContentsClient.getOnPageStartedHelper();
|
|
|
| loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
|
| - CommonResources.makeHtmlPageWithSimpleLinkTo(DATA_URL), "text/html", false);
|
| + CommonResources.makeHtmlPageWithSimpleLinkTo(
|
| + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL),
|
| + "text/html", false);
|
|
|
| final int shouldOverrideUrlLoadingCallCount =
|
| mShouldOverrideUrlLoadingHelper.getCallCount();
|
| @@ -271,7 +273,9 @@ public class AwContentsClientShouldOverrideUrlLoadingTest extends AwTestBase {
|
| final int onReceivedErrorCallCount = onReceivedErrorHelper.getCallCount();
|
|
|
| loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
|
| - CommonResources.makeHtmlPageWithSimpleLinkTo(DATA_URL), "text/html", false);
|
| + CommonResources.makeHtmlPageWithSimpleLinkTo(
|
| + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL),
|
| + "text/html", false);
|
|
|
| final int shouldOverrideUrlLoadingCallCount =
|
| mShouldOverrideUrlLoadingHelper.getCallCount();
|
| @@ -282,8 +286,7 @@ public class AwContentsClientShouldOverrideUrlLoadingTest extends AwTestBase {
|
|
|
| // After we load this URL we're certain that any in-flight callbacks for the previous
|
| // navigation have been delivered.
|
| - loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
|
| - ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL);
|
| + loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(), DATA_URL);
|
|
|
| assertEquals(onReceivedErrorCallCount, onReceivedErrorHelper.getCallCount());
|
| }
|
| @@ -334,16 +337,18 @@ public class AwContentsClientShouldOverrideUrlLoadingTest extends AwTestBase {
|
| public void testCalledWhenLinkClicked() throws Throwable {
|
| standardSetup();
|
|
|
| - // We can't go to about:blank from here because we'd get a cross-origin error.
|
| loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
|
| - CommonResources.makeHtmlPageWithSimpleLinkTo(DATA_URL), "text/html", false);
|
| + CommonResources.makeHtmlPageWithSimpleLinkTo(
|
| + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL),
|
| + "text/html", false);
|
|
|
| int callCount = mShouldOverrideUrlLoadingHelper.getCallCount();
|
|
|
| clickOnLinkUsingJs();
|
|
|
| mShouldOverrideUrlLoadingHelper.waitForCallback(callCount);
|
| - assertEquals(DATA_URL, mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl());
|
| + assertEquals(ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL,
|
| + mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl());
|
| assertFalse(mShouldOverrideUrlLoadingHelper.isRedirect());
|
| assertFalse(mShouldOverrideUrlLoadingHelper.hasUserGesture());
|
| assertTrue(mShouldOverrideUrlLoadingHelper.isMainFrame());
|
| @@ -493,30 +498,6 @@ public class AwContentsClientShouldOverrideUrlLoadingTest extends AwTestBase {
|
|
|
| @SmallTest
|
| @Feature({"AndroidWebView", "Navigation"})
|
| - public void testCalledForDataUrl() throws Throwable {
|
| - standardSetup();
|
| - final String dataUrl =
|
| - "data:text/html;base64,"
|
| - + "PGh0bWw+PGhlYWQ+PHRpdGxlPmRhdGFVcmxUZXN0QmFzZTY0PC90aXRsZT48"
|
| - + "L2hlYWQ+PC9odG1sPg==";
|
| - loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
|
| - CommonResources.makeHtmlPageWithSimpleLinkTo(dataUrl), "text/html", false);
|
| -
|
| - int callCount = mShouldOverrideUrlLoadingHelper.getCallCount();
|
| - clickOnLinkUsingJs();
|
| -
|
| - mShouldOverrideUrlLoadingHelper.waitForCallback(callCount);
|
| - assertTrue("Expected URL that starts with 'data:' but got: <"
|
| - + mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl() + "> instead.",
|
| - mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl().startsWith(
|
| - "data:"));
|
| - assertFalse(mShouldOverrideUrlLoadingHelper.isRedirect());
|
| - assertFalse(mShouldOverrideUrlLoadingHelper.hasUserGesture());
|
| - assertTrue(mShouldOverrideUrlLoadingHelper.isMainFrame());
|
| - }
|
| -
|
| - @SmallTest
|
| - @Feature({"AndroidWebView", "Navigation"})
|
| public void testCalledForUnsupportedSchemes() throws Throwable {
|
| standardSetup();
|
| final String unsupportedSchemeUrl = "foobar://resource/1";
|
| @@ -852,7 +833,9 @@ public class AwContentsClientShouldOverrideUrlLoadingTest extends AwTestBase {
|
| int onReceivedErrorCallCount = onReceivedErrorHelper.getCallCount();
|
|
|
| loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
|
| - CommonResources.makeHtmlPageWithSimpleLinkTo(DATA_URL), "text/html", false);
|
| + CommonResources.makeHtmlPageWithSimpleLinkTo(
|
| + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL),
|
| + "text/html", false);
|
|
|
| int shouldOverrideUrlLoadingCallCount = mShouldOverrideUrlLoadingHelper.getCallCount();
|
| setShouldOverrideUrlLoadingReturnValueOnUiThread(true);
|
|
|