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

Unified Diff: components/cronet/android/test/javatests/src/org/chromium/net/TestUrlRequestCallback.java

Issue 1393713005: [Cronet] Add error code and immediatelyRetryable() to UrlRequestException (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Helen's comments Created 5 years, 1 month 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
Index: components/cronet/android/test/javatests/src/org/chromium/net/TestUrlRequestCallback.java
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/TestUrlRequestCallback.java b/components/cronet/android/test/javatests/src/org/chromium/net/TestUrlRequestCallback.java
index c703de9b59641a90d2cacc519b00ba49a705e61f..eb2bb610d6fae2f6a9a23db1b6db049ca4a5c094 100644
--- a/components/cronet/android/test/javatests/src/org/chromium/net/TestUrlRequestCallback.java
+++ b/components/cronet/android/test/javatests/src/org/chromium/net/TestUrlRequestCallback.java
@@ -8,6 +8,7 @@ import android.os.ConditionVariable;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
@@ -215,6 +216,15 @@ class TestUrlRequestCallback extends UrlRequest.Callback {
assertFalse(mOnErrorCalled);
assertFalse(mOnCanceledCalled);
assertNull(mError);
+ if (mFailureType == FailureType.THROW_SYNC) {
+ assertEquals(UrlRequestError.LISTENER_THREW, error.getErrorCode());
+ assertEquals(0, error.getCronetInternalErrorCode());
+ assertEquals("UrlRequestListener method has thrown an exception", error.getMessage());
+ assertNotNull(error.getCause());
+ assertTrue(error.getCause() instanceof IllegalStateException);
+ assertEquals("Listener Exception.", error.getCause().getMessage());
+ assertFalse(error.immediatelyRetryable());
+ }
mOnErrorCalled = true;
mError = error;

Powered by Google App Engine
This is Rietveld 408576698