Chromium Code Reviews| Index: android_webview/javatests/src/org/chromium/android_webview/test/ClientOnReceivedErrorTest.java |
| diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/ClientOnReceivedErrorTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/ClientOnReceivedErrorTest.java |
| index c465e92b3ddb0fef33fc885453981467c8e78d78..d9497e7f878cb59b1461e6b03039c338437c29d3 100644 |
| --- a/android_webview/javatests/src/org/chromium/android_webview/test/ClientOnReceivedErrorTest.java |
| +++ b/android_webview/javatests/src/org/chromium/android_webview/test/ClientOnReceivedErrorTest.java |
| @@ -5,6 +5,7 @@ |
| package org.chromium.android_webview.test; |
| import android.test.suitebuilder.annotation.MediumTest; |
| +import android.webkit.WebSettings; |
| import org.chromium.android_webview.AwContents; |
| import org.chromium.android_webview.AndroidProtocolHandler; |
| @@ -118,4 +119,21 @@ public class ClientOnReceivedErrorTest extends AwTestBase { |
| assertEquals(url, onReceivedErrorHelper.getFailingUrl()); |
| assertNotNull(onReceivedErrorHelper.getDescription()); |
| } |
| + |
| + @MediumTest |
| + @Feature({"AndroidWebView"}) |
| + public void testCacheMiss() throws Throwable { |
| + TestCallbackHelperContainer.OnReceivedErrorHelper onReceivedErrorHelper = |
| + mContentsClient.getOnReceivedErrorHelper(); |
| + final String url = "http://example.com/index.html"; |
| + int onReceivedErrorCallCount = onReceivedErrorHelper.getCallCount(); |
| + getAwSettingsOnUiThread(mAwContents).setCacheMode(WebSettings.LOAD_CACHE_ONLY); |
| + loadUrlAsync(mAwContents, url); |
| + |
| + onReceivedErrorHelper.waitForCallback(onReceivedErrorCallCount); |
| + assertEquals(ErrorCodeConversionHelper.ERROR_UNKNOWN, |
| + onReceivedErrorHelper.getErrorCode()); |
| + assertEquals(url, onReceivedErrorHelper.getFailingUrl()); |
| + assertNotNull(onReceivedErrorHelper.getDescription()); |
|
joth
2013/06/04 17:43:19
assert it's not empty string too?
mnaganov (inactive)
2013/06/05 09:28:25
Bingo! The code wasn't actually working. See https
|
| + } |
| } |