Commit f87cca5c authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

AW: modify test for PlzNavigate

No change to production code.

This test was previously modified to anticipate the behavior change for
loadDataWithBaseURL (namely, that we now call shouldInterceptRequest)
caused by PlzNavigate, with backwards compatibility for the old code
path.

This removes the support for the old code path, and asserts the new
behavior. As with http://crrev/c/820717, this leaves a TODO to actually
assert the URL intercepted for the main resource, since this value is
not yet finalized.

Bug: 822124
Test: run_webview_instrumentation_test_apk -f AwContentsClientShouldInterceptRequestTest#testBaseUrlOfLoadDataSentInRefererHeader
Change-Id: I315e1c0c310cda116603ee4026e15d89947760df
Reviewed-on: https://chromium-review.googlesource.com/967082Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543827}
parent 5fe0eef0
......@@ -874,13 +874,14 @@ public class AwContentsClientShouldInterceptRequestTest {
mAwContents, pageHtml, "text/html", false, baseUrl, null);
mShouldInterceptRequestHelper.waitForCallback(callCount, 1);
Assert.assertEquals(1, mShouldInterceptRequestHelper.getUrls().size());
if (!mShouldInterceptRequestHelper.getUrls().get(0).equals(imageUrl)) {
// With PlzNavigate, data URLs are intercepted so wait for the next request.
// See https://codereview.chromium.org/2235303002/.
callCount = mShouldInterceptRequestHelper.getCallCount();
mShouldInterceptRequestHelper.waitForCallback(callCount, 1);
Assert.assertEquals(imageUrl, mShouldInterceptRequestHelper.getUrls().get(1));
}
// With PlzNavigate, data URLs are intercepted. See
// https://codereview.chromium.org/2235303002/.
// TODO(boliu): Not checking the URL yet. It's the empty data URL which should be fixed in
// crbug.com/669885.
Assert.assertNotEquals(imageUrl, mShouldInterceptRequestHelper.getUrls().get(0));
mShouldInterceptRequestHelper.waitForCallback(callCount + 1);
Assert.assertEquals(imageUrl, mShouldInterceptRequestHelper.getUrls().get(1));
Map<String, String> headers =
mShouldInterceptRequestHelper.getRequestsForUrl(imageUrl).requestHeaders;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment