| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.android_webview.test; | 5 package org.chromium.android_webview.test; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.test.suitebuilder.annotation.MediumTest; | 8 import android.test.suitebuilder.annotation.MediumTest; |
| 9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.test.suitebuilder.annotation.SmallTest; |
| 10 | 10 |
| 11 import org.chromium.android_webview.AwBrowserProcess; | 11 import org.chromium.android_webview.AwBrowserProcess; |
| 12 import org.chromium.android_webview.AwContents; | 12 import org.chromium.android_webview.AwContents; |
| 13 import org.chromium.android_webview.AwCookieManager; | 13 import org.chromium.android_webview.AwCookieManager; |
| 14 import org.chromium.android_webview.InterceptedRequestData; | 14 import org.chromium.android_webview.AwWebResourceResponse; |
| 15 import org.chromium.android_webview.test.util.CommonResources; | 15 import org.chromium.android_webview.test.util.CommonResources; |
| 16 import org.chromium.android_webview.test.util.CookieUtils; | 16 import org.chromium.android_webview.test.util.CookieUtils; |
| 17 import org.chromium.base.test.util.Feature; | 17 import org.chromium.base.test.util.Feature; |
| 18 import org.chromium.content.app.ContentMain; | 18 import org.chromium.content.app.ContentMain; |
| 19 import org.chromium.net.test.util.TestWebServer; | 19 import org.chromium.net.test.util.TestWebServer; |
| 20 | 20 |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * Tests for CookieManager/Chromium startup ordering weirdness. | 23 * Tests for CookieManager/Chromium startup ordering weirdness. |
| 24 */ | 24 */ |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 assertTrue(cookieManager.acceptCookie()); | 113 assertTrue(cookieManager.acceptCookie()); |
| 114 } | 114 } |
| 115 | 115 |
| 116 // https://code.google.com/p/chromium/issues/detail?id=374203 | 116 // https://code.google.com/p/chromium/issues/detail?id=374203 |
| 117 @MediumTest | 117 @MediumTest |
| 118 @Feature({"AndroidWebView"}) | 118 @Feature({"AndroidWebView"}) |
| 119 public void testShouldInterceptRequestDeadlock() throws Throwable { | 119 public void testShouldInterceptRequestDeadlock() throws Throwable { |
| 120 String url = "http://www.example.com"; | 120 String url = "http://www.example.com"; |
| 121 TestAwContentsClient contentsClient = new TestAwContentsClient() { | 121 TestAwContentsClient contentsClient = new TestAwContentsClient() { |
| 122 @Override | 122 @Override |
| 123 public InterceptedRequestData shouldInterceptRequest(String url) { | 123 public AwWebResourceResponse shouldInterceptRequest( |
| 124 ShouldInterceptRequestParams params) { |
| 124 (new AwCookieManager()).getCookie("www.example.com"); | 125 (new AwCookieManager()).getCookie("www.example.com"); |
| 125 return null; | 126 return null; |
| 126 } | 127 } |
| 127 }; | 128 }; |
| 128 startChromiumWithClient(contentsClient); | 129 startChromiumWithClient(contentsClient); |
| 129 loadUrlSync(mAwContents, contentsClient.getOnPageFinishedHelper(), url); | 130 loadUrlSync(mAwContents, contentsClient.getOnPageFinishedHelper(), url); |
| 130 } | 131 } |
| 131 } | 132 } |
| OLD | NEW |