1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Copyright (c) 2014 Intel Corporation. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
6 package org.xwalk.core.xwview.test;
8 import android.test.suitebuilder.annotation.SmallTest;
9 import android.util.Pair;
11 import java.util.ArrayList;
12 import java.util.concurrent.Callable;
13 import java.util.concurrent.TimeUnit;
14 import java.util.List;
16 import org.chromium.base.test.util.DisabledTest;
17 import org.chromium.base.test.util.Feature;
18 import org.chromium.content_public.browser.LoadUrlParams;
19 import org.chromium.content.browser.test.util.CallbackHelper;
20 import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPageFinishedHelper;
21 import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPageStartedHelper;
22 import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnReceivedErrorHelper;
23 import org.chromium.net.test.util.TestWebServer;
25 import org.xwalk.core.xwview.test.util.CommonResources;
28 * Tests for the shouldOverrideUrlLoading() method.
30 public class ShouldOverrideUrlLoadingTest extends XWalkViewTestBase {
31 private static final String ABOUT_BLANK_URL = "about:blank";
32 private static final String DATA_URL = "data:text/html,<div/>";
33 private static final String REDIRECT_TARGET_PATH = "/redirect_target.html";
34 private static final String TITLE = "TITLE";
35 private TestHelperBridge.ShouldOverrideUrlLoadingHelper mShouldOverrideUrlLoadingHelper;
36 private OnPageFinishedHelper mOnPageFinishedHelper;
37 private TestWebServer mWebServer;
40 protected void setUp() throws Exception {
42 mShouldOverrideUrlLoadingHelper = mTestHelperBridge.getShouldOverrideUrlLoadingHelper();
43 mOnPageFinishedHelper = mTestHelperBridge.getOnPageFinishedHelper();
44 mWebServer = TestWebServer.start();
48 protected void tearDown() throws Exception {
49 mWebServer.shutdown();
53 // Since this value is read on the UI thread, it's simpler to set it there too.
54 void setShouldOverrideUrlLoadingReturnValueOnUiThread(
55 final boolean value) throws Throwable {
56 runTestOnUiThread(new Runnable() {
59 mShouldOverrideUrlLoadingHelper.setShouldOverrideUrlLoadingReturnValue(value);
64 private String getTestPageCommonHeaders() {
65 return "<title>" + TITLE + "</title> ";
68 private String makeHtmlPageFrom(String headers, String body) {
69 return CommonResources.makeHtmlPageFrom(getTestPageCommonHeaders() + headers, body);
72 private String getHtmlForPageWithJsAssignLinkTo(String url) {
73 return makeHtmlPageFrom("",
74 "<img onclick=\"location.href='" + url + "'\" class=\"big\" id=\"link\" />");
77 private String getHtmlForPageWithJsReplaceLinkTo(String url) {
78 return makeHtmlPageFrom("",
79 "<img onclick=\"location.replace('" + url + "');\" class=\"big\" id=\"link\" />");
82 private String getHtmlForPageWithMetaRefreshRedirectTo(String url) {
83 return makeHtmlPageFrom("<meta http-equiv=\"refresh\" content=\"0;url=" + url + "\" />",
84 "<div>Meta refresh redirect</div>");
87 private String getHtmlForPageWithJsRedirectTo(String url, String method, int timeout) {
88 return makeHtmlPageFrom(
90 "function doRedirectAssign() {" +
91 "location.href = '" + url + "';" +
93 "function doRedirectReplace() {" +
94 "location.replace('" + url + "');" +
97 String.format("<iframe onLoad=\"setTimeout('doRedirect%s()', %d);\" />",
101 private String addPageToTestServer(TestWebServer webServer, String httpPath, String html) {
102 List<Pair<String, String>> headers = new ArrayList<Pair<String, String>>();
103 headers.add(Pair.create("Content-Type", "text/html"));
104 headers.add(Pair.create("Cache-Control", "no-store"));
105 return webServer.setResponse(httpPath, html, headers);
108 private String createRedirectTargetPage(TestWebServer webServer) {
109 return addPageToTestServer(webServer, REDIRECT_TARGET_PATH,
110 makeHtmlPageFrom("", "<div>This is the end of the redirect chain</div>"));
114 @Feature({"XWalkView", "Navigation"})
115 public void testNotCalledOnLoadData() throws Throwable {
117 CommonResources.makeHtmlPageWithSimpleLinkTo(DATA_URL), "text/html", false);
119 assertEquals(0, mShouldOverrideUrlLoadingHelper.getCallCount());
122 private void waitForNavigationRunnableAndAssertTitleChanged(
123 CallbackHelper onPageFinishedHelper,
124 Runnable navigationRunnable) throws Exception {
125 final int callCount = onPageFinishedHelper.getCallCount();
126 final String oldTitle = getTitleOnUiThread();
127 getInstrumentation().runOnMainSync(navigationRunnable);
128 onPageFinishedHelper.waitForCallback(callCount);
129 assertFalse(oldTitle.equals(getTitleOnUiThread()));
133 @Feature({"XWalkView", "Navigation"})
134 public void testCalledOnBackForwardNavigation() throws Throwable {
135 final String url = "file:///android_asset/www/index.html";
136 final String httpPath = "/test.html";
137 final String httpPathOnServer = mWebServer.getResponseUrl(httpPath);
138 addPageToTestServer(mWebServer, httpPath,
139 CommonResources.makeHtmlPageWithSimpleLinkTo(httpPathOnServer));
141 loadUrlSync(httpPathOnServer);
143 assertEquals(2, mShouldOverrideUrlLoadingHelper.getCallCount());
144 String oldTitle = getTitleOnUiThread();
146 assertFalse(oldTitle.equals(getTitleOnUiThread()));
147 assertEquals(3, mShouldOverrideUrlLoadingHelper.getCallCount());
149 oldTitle = getTitleOnUiThread();
151 assertFalse(oldTitle.equals(getTitleOnUiThread()));
152 assertEquals(4, mShouldOverrideUrlLoadingHelper.getCallCount());
156 @Feature({"XWalkView", "Navigation"})
157 public void testCantBlockLoads() throws Throwable {
158 setShouldOverrideUrlLoadingReturnValueOnUiThread(true);
161 CommonResources.makeHtmlPageWithSimpleLinkTo(getTestPageCommonHeaders(),
162 DATA_URL), "text/html", false);
164 assertEquals(TITLE, getTitleOnUiThread());
168 @Feature({"XWalkView", "Navigation"})
169 public void testCalledBeforeOnPageStarted() throws Throwable {
170 OnPageStartedHelper onPageStartedHelper = mTestHelperBridge.getOnPageStartedHelper();
173 CommonResources.makeHtmlPageWithSimpleLinkTo(DATA_URL), "text/html", false);
175 final int shouldOverrideUrlLoadingCallCount = mShouldOverrideUrlLoadingHelper.getCallCount();
176 final int onPageStartedCallCount = onPageStartedHelper.getCallCount();
177 setShouldOverrideUrlLoadingReturnValueOnUiThread(true);
178 clickOnElementId("link", null);
180 mShouldOverrideUrlLoadingHelper.waitForCallback(shouldOverrideUrlLoadingCallCount);
181 assertEquals(onPageStartedCallCount, onPageStartedHelper.getCallCount());
185 @Feature({"XWalkView", "Navigation"})
186 public void testDoesNotCauseOnReceivedError() throws Throwable {
187 OnReceivedErrorHelper onReceivedErrorHelper = mTestHelperBridge.getOnReceivedErrorHelper();
188 final int onReceivedErrorCallCount = onReceivedErrorHelper.getCallCount();
191 CommonResources.makeHtmlPageWithSimpleLinkTo(DATA_URL), "text/html", false);
193 final int shouldOverrideUrlLoadingCallCount = mShouldOverrideUrlLoadingHelper.getCallCount();
195 setShouldOverrideUrlLoadingReturnValueOnUiThread(true);
197 clickOnElementId("link", null);
199 mShouldOverrideUrlLoadingHelper.waitForCallback(shouldOverrideUrlLoadingCallCount);
201 setShouldOverrideUrlLoadingReturnValueOnUiThread(false);
203 // After we load this URL we're certain that any in-flight callbacks for the previous
204 // navigation have been delivered.
205 loadUrlSync(ABOUT_BLANK_URL);
207 assertEquals(onReceivedErrorCallCount, onReceivedErrorHelper.getCallCount());
211 @Feature({"XWalkView", "Navigation"})
212 public void testNotCalledForAnchorNavigations() throws Throwable {
213 doTestNotCalledForAnchorNavigations(false);
217 @Feature({"XWalkView", "Navigation"})
218 public void testNotCalledForAnchorNavigationsWithNonHierarchicalScheme() throws Throwable {
219 doTestNotCalledForAnchorNavigations(true);
222 private void doTestNotCalledForAnchorNavigations(boolean useLoadData) throws Throwable {
223 final String anchorLinkPath = "/anchor_link.html";
224 final String anchorLinkUrl = mWebServer.getResponseUrl(anchorLinkPath);
225 addPageToTestServer(mWebServer, anchorLinkPath,
226 CommonResources.makeHtmlPageWithSimpleLinkTo(anchorLinkUrl + "#anchor"));
230 CommonResources.makeHtmlPageWithSimpleLinkTo("#anchor"), "text/html", false);
232 loadUrlSync(anchorLinkUrl);
235 final int shouldOverrideUrlLoadingCallCount = mShouldOverrideUrlLoadingHelper.getCallCount();
237 clickOnElementId("link", null);
239 // After we load this URL we're certain that any in-flight callbacks for the previous
240 // navigation have been delivered.
241 loadUrlSync(ABOUT_BLANK_URL);
243 assertEquals(shouldOverrideUrlLoadingCallCount,
244 mShouldOverrideUrlLoadingHelper.getCallCount());
248 @Feature({"XWalkView", "Navigation"})
249 public void testCalledWhenLinkClicked() throws Throwable {
250 // We can't go to about:blank from here because we'd get a cross-origin error.
252 CommonResources.makeHtmlPageWithSimpleLinkTo(DATA_URL), "text/html", false);
254 int callCount = mShouldOverrideUrlLoadingHelper.getCallCount();
256 clickOnElementId("link", null);
258 mShouldOverrideUrlLoadingHelper.waitForCallback(callCount);
262 @Feature({"XWalkView", "Navigation"})
263 public void testCalledWhenSelfLinkClicked() throws Throwable {
264 final String httpPath = "/page_with_link_to_self.html";
265 final String httpPathOnServer = mWebServer.getResponseUrl(httpPath);
266 addPageToTestServer(mWebServer, httpPath,
267 CommonResources.makeHtmlPageWithSimpleLinkTo(httpPathOnServer));
269 loadUrlSync(httpPathOnServer);
271 int callCount = mShouldOverrideUrlLoadingHelper.getCallCount();
273 clickOnElementId("link", null);
275 mShouldOverrideUrlLoadingHelper.waitForCallback(callCount);
276 assertEquals(httpPathOnServer,
277 mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl());
281 @Feature({"XWalkView", "Navigation"})
282 public void testCalledWhenNavigatingFromJavaScriptUsingAssign()
284 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
286 getHtmlForPageWithJsAssignLinkTo(redirectTargetUrl), "text/html", false);
288 int callCount = mShouldOverrideUrlLoadingHelper.getCallCount();
290 clickOnElementId("link", null);
292 mShouldOverrideUrlLoadingHelper.waitForCallback(callCount);
296 @Feature({"XWalkView", "Navigation"})
297 public void testCalledWhenNavigatingFromJavaScriptUsingReplace()
299 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
301 getHtmlForPageWithJsReplaceLinkTo(redirectTargetUrl), "text/html", false);
303 int callCount = mShouldOverrideUrlLoadingHelper.getCallCount();
304 clickOnElementId("link", null);
305 mShouldOverrideUrlLoadingHelper.waitForCallback(callCount);
309 @Feature({"XWalkView", "Navigation"})
310 public void testPassesCorrectUrl() throws Throwable {
311 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
313 CommonResources.makeHtmlPageWithSimpleLinkTo(redirectTargetUrl), "text/html", false);
315 int callCount = mShouldOverrideUrlLoadingHelper.getCallCount();
316 clickOnElementId("link", null);
317 mShouldOverrideUrlLoadingHelper.waitForCallback(callCount);
318 assertEquals(redirectTargetUrl,
319 mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl());
322 // This test case is not stable, disable it temporarily.
324 // @Feature({"XWalkView", "Navigation"})
326 public void testCanIgnoreLoading() throws Throwable {
327 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
328 final String pageWithLinkToIgnorePath = "/page_with_link_to_ignore.html";
329 final String pageWithLinkToIgnoreUrl = addPageToTestServer(mWebServer,
330 pageWithLinkToIgnorePath, CommonResources.makeHtmlPageWithSimpleLinkTo(redirectTargetUrl));
331 final String synchronizationPath = "/sync.html";
332 final String synchronizationUrl = addPageToTestServer(mWebServer, synchronizationPath,
333 CommonResources.makeHtmlPageWithSimpleLinkTo(redirectTargetUrl));
335 loadUrlSync(pageWithLinkToIgnoreUrl);
337 setShouldOverrideUrlLoadingReturnValueOnUiThread(true);
339 int callCount = mShouldOverrideUrlLoadingHelper.getCallCount();
340 clickOnElementId("link", null);
341 // Some time around here true should be returned from the shouldOverrideUrlLoading
342 // callback causing the navigation caused by calling clickOnElementId to be ignored.
343 // We validate this by checking which pages were loaded on the server.
344 mShouldOverrideUrlLoadingHelper.waitForCallback(callCount);
345 mOnPageFinishedHelper.waitForCallback(
346 mOnPageFinishedHelper.getCallCount(), 1, 15, TimeUnit.SECONDS);
348 setShouldOverrideUrlLoadingReturnValueOnUiThread(false);
350 loadUrlSync(synchronizationUrl);
352 assertEquals(1, mWebServer.getRequestCount(pageWithLinkToIgnorePath));
353 assertEquals(1, mWebServer.getRequestCount(synchronizationPath));
354 assertEquals(0, mWebServer.getRequestCount(REDIRECT_TARGET_PATH));
358 @Feature({"XWalkView", "Navigation"})
359 public void testCalledForDataUrl() throws Throwable {
360 final String dataUrl =
361 "data:text/html;base64," +
362 "PGh0bWw+PGhlYWQ+PHRpdGxlPmRhdGFVcmxUZXN0QmFzZTY0PC90aXRsZT48" +
363 "L2hlYWQ+PC9odG1sPg==";
365 CommonResources.makeHtmlPageWithSimpleLinkTo(dataUrl), "text/html", false);
367 int callCount = mShouldOverrideUrlLoadingHelper.getCallCount();
368 clickOnElementId("link", null);
370 mShouldOverrideUrlLoadingHelper.waitForCallback(callCount);
371 assertTrue("Expected URL that starts with 'data:' but got: <" +
372 mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl() + "> instead.",
373 mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl().startsWith(
378 @Feature({"XWalkView", "Navigation"})
379 public void testCalledForUnsupportedSchemes() throws Throwable {
380 final String unsupportedSchemeUrl = "foobar://resource/1";
382 CommonResources.makeHtmlPageWithSimpleLinkTo(unsupportedSchemeUrl), "text/html",
385 int callCount = mShouldOverrideUrlLoadingHelper.getCallCount();
386 clickOnElementId("link", null);
388 mShouldOverrideUrlLoadingHelper.waitForCallback(callCount);
389 assertEquals(unsupportedSchemeUrl,
390 mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl());
394 @Feature({"XWalkView", "Navigation"})
395 public void testCalledForPostNavigations() throws Throwable {
396 // The reason POST requests are excluded is BUG 155250.
397 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
398 final String postLinkUrl = addPageToTestServer(mWebServer, "/page_with_post_link.html",
399 CommonResources.makeHtmlPageWithSimplePostFormTo(redirectTargetUrl));
401 loadUrlSync(postLinkUrl);
403 final int shouldOverrideUrlLoadingCallCount =
404 mShouldOverrideUrlLoadingHelper.getCallCount();
406 assertEquals(0, mWebServer.getRequestCount(REDIRECT_TARGET_PATH));
407 clickOnElementId("link", null);
409 // Wait for the target URL to be fetched from the server.
410 pollOnUiThread(new Callable<Boolean>() {
412 public Boolean call() throws Exception {
413 return mWebServer.getRequestCount(REDIRECT_TARGET_PATH) == 1;
417 // Since the targetURL was loaded from the test server it means all processing related
418 // to dispatching a shouldOverrideUrlLoading callback had finished and checking the call
420 assertEquals(shouldOverrideUrlLoadingCallCount + 1,
421 mShouldOverrideUrlLoadingHelper.getCallCount());
425 @Feature({"XWalkView", "Navigation"})
426 public void testCalledFor302AfterPostNavigations() throws Throwable {
427 // The reason POST requests are excluded is BUG 155250.
428 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
429 final String postToGetRedirectUrl = mWebServer.setRedirect("/302.html", redirectTargetUrl);
430 final String postLinkUrl = addPageToTestServer(mWebServer, "/page_with_post_link.html",
431 CommonResources.makeHtmlPageWithSimplePostFormTo(postToGetRedirectUrl));
433 loadUrlSync(postLinkUrl);
435 final int shouldOverrideUrlLoadingCallCount = mShouldOverrideUrlLoadingHelper.getCallCount();
437 clickOnElementId("link", null);
439 mShouldOverrideUrlLoadingHelper.waitForCallback(shouldOverrideUrlLoadingCallCount);
441 // Wait for the target URL to be fetched from the server.
442 pollOnUiThread(new Callable<Boolean>() {
444 public Boolean call() throws Exception {
445 return mWebServer.getRequestCount(REDIRECT_TARGET_PATH) == 1;
449 assertEquals(redirectTargetUrl,
450 mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl());
454 @Feature({"XWalkView", "Navigation"})
455 public void testCalledForIframeHttpNavigations() throws Throwable {
456 final String iframeRedirectTargetUrl = createRedirectTargetPage(mWebServer);
457 final String iframeRedirectUrl = mWebServer.setRedirect("/302.html", iframeRedirectTargetUrl);
458 final String pageWithIframeUrl = addPageToTestServer(mWebServer, "/iframe_intercept.html",
459 makeHtmlPageFrom("", "<iframe src=\"" + iframeRedirectUrl + "\" />"));
461 assertEquals(0, mWebServer.getRequestCount(REDIRECT_TARGET_PATH));
462 loadUrlSync(pageWithIframeUrl);
464 // Wait for the redirect target URL to be fetched from the server.
465 pollOnUiThread(new Callable<Boolean>() {
467 public Boolean call() throws Exception {
468 return mWebServer.getRequestCount(REDIRECT_TARGET_PATH) == 1;
472 assertEquals(1, mShouldOverrideUrlLoadingHelper.getCallCount());
476 * Worker method for the various redirect tests.
478 * Calling this will first load the redirect URL built from redirectFilePath, query and
479 * locationFilePath and assert that we get a override callback for the destination.
480 * The second part of the test loads a page that contains a link which points at the redirect
481 * URL. We expect two callbacks - one for the redirect link and another for the destination.
483 private void doTestCalledOnRedirect(TestWebServer webServer,
484 String redirectUrl, String redirectTarget) throws Throwable {
485 final String pageWithLinkToRedirectUrl = addPageToTestServer(webServer,
486 "/page_with_link_to_redirect.html",
487 CommonResources.makeHtmlPageWithSimpleLinkTo(redirectUrl));
488 int directLoadCallCount = mShouldOverrideUrlLoadingHelper.getCallCount();
489 loadUrlSync(redirectUrl);
491 mShouldOverrideUrlLoadingHelper.waitForCallback(directLoadCallCount, 2);
492 assertEquals(redirectTarget,
493 mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl());
495 int indirectLoadCallCount = mShouldOverrideUrlLoadingHelper.getCallCount();
496 loadUrlSync(pageWithLinkToRedirectUrl);
498 clickOnElementId("link", null);
500 mShouldOverrideUrlLoadingHelper.waitForCallback(indirectLoadCallCount, 3);
501 assertEquals(redirectTarget,
502 mShouldOverrideUrlLoadingHelper.getShouldOverrideUrlLoadingUrl());
503 assertEquals(redirectUrl,
504 mShouldOverrideUrlLoadingHelper.getPreviousShouldOverrideUrlLoadingUrl());
508 @Feature({"XWalkView", "Navigation"})
509 public void testCalledOn302Redirect() throws Throwable {
510 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
511 final String redirectUrl = mWebServer.setRedirect("/302.html", redirectTargetUrl);
513 doTestCalledOnRedirect(mWebServer, redirectUrl, redirectTargetUrl);
517 @Feature({"XWalkView", "Navigation"})
518 public void testCalledOnMetaRefreshRedirect() throws Throwable {
519 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
520 final String redirectUrl = addPageToTestServer(mWebServer, "/meta_refresh.html",
521 getHtmlForPageWithMetaRefreshRedirectTo(redirectTargetUrl));
522 doTestCalledOnRedirect(mWebServer, redirectUrl, redirectTargetUrl);
527 @Feature({"XWalkView", "Navigation"})
528 public void testCalledOnJavaScriptLocationImmediateAssignRedirect()
530 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
531 final String redirectUrl = addPageToTestServer(mWebServer, "/js_immediate_assign.html",
532 getHtmlForPageWithJsRedirectTo(redirectTargetUrl, "Assign", 0));
533 doTestCalledOnRedirect(mWebServer, redirectUrl, redirectTargetUrl);
537 @Feature({"XWalkView", "Navigation"})
538 public void testCalledOnJavaScriptLocationImmediateReplaceRedirect()
540 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
541 final String redirectUrl = addPageToTestServer(mWebServer, "/js_immediate_replace.html",
542 getHtmlForPageWithJsRedirectTo(redirectTargetUrl, "Replace", 0));
543 doTestCalledOnRedirect(mWebServer, redirectUrl, redirectTargetUrl);
547 @Feature({"XWalkView", "Navigation"})
548 public void testCalledOnJavaScriptLocationDelayedAssignRedirect()
550 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
551 final String redirectUrl = addPageToTestServer(mWebServer, "/js_delayed_assign.html",
552 getHtmlForPageWithJsRedirectTo(redirectTargetUrl, "Assign", 100));
553 doTestCalledOnRedirect(mWebServer, redirectUrl, redirectTargetUrl);
557 @Feature({"XWalkView", "Navigation"})
558 public void testCalledOnJavaScriptLocationDelayedReplaceRedirect()
560 final String redirectTargetUrl = createRedirectTargetPage(mWebServer);
561 final String redirectUrl = addPageToTestServer(mWebServer, "/js_delayed_replace.html",
562 getHtmlForPageWithJsRedirectTo(redirectTargetUrl, "Replace", 100));
563 doTestCalledOnRedirect(mWebServer, redirectUrl, redirectTargetUrl);
567 @Feature({"XWalkView", "Navigation"})
568 public void testDoubleNavigateDoesNotSuppressInitialNavigate() throws Throwable {
569 final String jsUrl = "javascript:try{console.log('processed js loadUrl');}catch(e){};";
571 // Do a double navigagtion, the second being an effective no-op, in quick succession (i.e.
572 // without yielding the main thread inbetween).
574 CommonResources.makeHtmlPageWithSimpleLinkTo(DATA_URL), "text/html", false);
575 loadJavaScriptUrl(jsUrl);
576 assertEquals(0, mShouldOverrideUrlLoadingHelper.getCallCount());