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

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

Issue 2198083002: Fix flaky testRequestFinishedListenerFailedRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | 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/RequestFinishedListenerTest.java
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedListenerTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedListenerTest.java
index 48f7266226a3239873c42acb560f49c612c5b56c..53e1850f2770b601a0fc90985056c60d3f2cd2be 100644
--- a/components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedListenerTest.java
+++ b/components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedListenerTest.java
@@ -232,7 +232,8 @@ public class RequestFinishedListenerTest extends CronetTestBase {
assertTrue(requestInfo.getAnnotations().isEmpty());
CronetEngine.UrlRequestMetrics metrics = requestInfo.getMetrics();
assertNotNull("UrlRequestInfo.getMetrics() must not be null", metrics);
- assertTrue(metrics.getTotalTimeMs() > 0);
+ // The failure is occasionally fast enough that time reported is 0, so just check for null
+ assertNotNull(metrics.getTotalTimeMs());
assertNull(metrics.getTtfbMs());
assertTrue(metrics.getReceivedBytesCount() == null || metrics.getReceivedBytesCount() == 0);
mTestFramework.mCronetEngine.shutdown();
« 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