Commit 252f02df authored by Laís Minchillo's avatar Laís Minchillo Committed by Commit Bot

[aw] Test loadUrl with ImmutableMap

Change testCanInjectHeaders to pass an ImmutableMap to loadUrl instead
of a mutable map. Some older WebView versions would crash if an
immutable map was passed. This test now prevents this to regress in the
future.

R=ntfschr

Test: run_webview_instrumentation_test_apk -f *testCanInjectHeaders*
Change-Id: Ie74893361088dec46f0470ba934b1d185dc0f9fb
Fixed: 1032049
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2449473
Auto-Submit: Laís Minchillo <laisminchillo@chromium.org>
Commit-Queue: Richard Coles <torne@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815128}
parent 37d9075a
......@@ -25,6 +25,8 @@ import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
import androidx.test.filters.SmallTest;
import com.google.common.collect.ImmutableMap;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
......@@ -538,10 +540,8 @@ public class AwContentsTest {
url = testServer.getURL("/echoheader?Referer");
extraHeaders.clear();
extraHeaders.put("Referer", "http://www.example.com/");
mActivityTestRule.loadUrlSync(
awContents, mContentsClient.getOnPageFinishedHelper(), url, extraHeaders);
mActivityTestRule.loadUrlSync(awContents, mContentsClient.getOnPageFinishedHelper(),
url, ImmutableMap.of("Referer", "http://www.example.com/"));
String referer = mActivityTestRule.getJavaScriptResultBodyTextContent(
awContents, mContentsClient);
......
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