Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java

Issue 2749513002: Fix AwContentsClientShouldInterceptRequestTest#testBaseUrlOfLoadDataSentInRefererHeader with PlzNav… (Closed)
Patch Set: without PlzNavigate Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java
index a672ca13bffc8f81f4d81eb416624fc862669717..23dbe08429857db455d909275b1e40f4aa6f9fc9 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java
@@ -826,7 +826,14 @@ public class AwContentsClientShouldInterceptRequestTest extends AwTestBase {
loadDataWithBaseUrlAsync(mAwContents, pageHtml, "text/html", false, baseUrl, null);
mShouldInterceptRequestHelper.waitForCallback(callCount, 1);
assertEquals(1, mShouldInterceptRequestHelper.getUrls().size());
- assertEquals(imageUrl, mShouldInterceptRequestHelper.getUrls().get(0));
+ 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);
+ assertEquals(imageUrl, mShouldInterceptRequestHelper.getUrls().get(1));
+ }
+
Map<String, String> headers =
mShouldInterceptRequestHelper.getRequestsForUrl(imageUrl).requestHeaders;
assertTrue(headers.containsKey(refererHeaderName));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698