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

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

Issue 2572693003: Fix CronetUrlRequestTest#testFailures flake (Closed)
Patch Set: Use a conditional and not skip all CANCEL_ASYNC_WITHOUT_PAUSE Created 4 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java
index afe7a3c39282c9db13a40e8db822fd4c448ef76f..56a84441b13f817c0973f6465f4aa4b4517a3b8e 100644
--- a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java
+++ b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java
@@ -1679,10 +1679,16 @@ public class CronetUrlRequestTest extends CronetTestBase {
assertEquals(expectResponseInfo, callback.mResponseInfo != null);
assertEquals(expectError, callback.mError != null);
assertEquals(expectError, callback.mOnErrorCalled);
- assertEquals(failureType == FailureType.CANCEL_SYNC
- || failureType == FailureType.CANCEL_ASYNC
- || failureType == FailureType.CANCEL_ASYNC_WITHOUT_PAUSE,
- callback.mOnCanceledCalled);
+ // When failureType is FailureType.CANCEL_ASYNC_WITHOUT_PAUSE and failureStep is
+ // ResponseStep.ON_READ_COMPLETED, there might be an onSucceeded() task already posted. If
+ // that's the case, onCanceled() will not be invoked. See crbug.com/657415.
+ if (!(failureType == FailureType.CANCEL_ASYNC_WITHOUT_PAUSE
+ && failureStep == ResponseStep.ON_READ_COMPLETED)) {
+ assertEquals(failureType == FailureType.CANCEL_SYNC
+ || failureType == FailureType.CANCEL_ASYNC
+ || failureType == FailureType.CANCEL_ASYNC_WITHOUT_PAUSE,
+ callback.mOnCanceledCalled);
+ }
}
@SmallTest
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698