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

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

Issue 15979017: [Android WebView] Provide a minimal error description for nav errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a test Created 7 years, 6 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 | android_webview/renderer/aw_content_renderer_client.cc » ('j') | 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/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
+ }
}
« no previous file with comments | « no previous file | android_webview/renderer/aw_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698