| 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 e1bcb59fbff68cbabf4c3b1686847cb21c992c8e..34c0511f30a46c4b725df919dc55f41777cfe5bd 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
|
| @@ -465,6 +465,9 @@ public class AwContentsClientShouldInterceptRequestTest extends AwTestBase {
|
| " return xhr.getResponseHeader('" + headerName + "');" +
|
| "})();";
|
| String header = executeJavaScriptAndWaitForResult(awContents, contentsClient, syncGetJs);
|
| +
|
| + if (header.equals("null"))
|
| + return null;
|
| // JSON stringification applied by executeJavaScriptAndWaitForResult adds quotes
|
| // around returned strings.
|
| assertTrue(header.length() > 2);
|
| @@ -516,6 +519,20 @@ public class AwContentsClientShouldInterceptRequestTest extends AwTestBase {
|
| getHeaderValue(mAwContents, mContentsClient, syncGetUrl, clientResponseHeaderName));
|
| }
|
|
|
| + @SmallTest
|
| + @Feature({"AndroidWebView"})
|
| + public void testNullHttpResponseHeaders() throws Throwable {
|
| + final String syncGetUrl = mWebServer.getResponseUrl("/intercept_me");
|
| + enableJavaScriptOnUiThread(mAwContents);
|
| +
|
| + final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
|
| + loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(), aboutPageUrl);
|
| +
|
| + mShouldInterceptRequestHelper.setReturnValue(
|
| + new AwWebResourceResponse("text/html", "UTF-8", null, 0, null, null));
|
| + assertEquals(null, getHeaderValue(mAwContents, mContentsClient, syncGetUrl, "Some-Header"));
|
| + }
|
| +
|
| private String makePageWithTitle(String title) {
|
| return CommonResources.makeHtmlPageFrom("<title>" + title + "</title>",
|
| "<div> The title is: " + title + " </div>");
|
|
|