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

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

Issue 1999303002: Fix flaky NQE cronet test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/CronetUrlRequestContextTest.java
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
index f79e4116ed30e0d559f315583e007aa41c5f6261..8e69643a1e03d49858dd71bcf1b10e2492b24f13 100644
--- a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
+++ b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
@@ -270,13 +270,10 @@ public class CronetUrlRequestContextTest extends CronetTestBase {
mTestFramework.mCronetEngine.shutdown();
}
- /*
@SmallTest
@Feature({"Cronet"})
// TODO(xunjieli): Remove annotation after crbug.com/539519 is fixed.
xunjieli 2016/05/24 18:26:38 Since you are here, do you mind getting rid of thi
tbansal1 2016/05/26 18:02:59 Done.
@SuppressWarnings("deprecation")
- */
- @FlakyTest(message = "http://crbug.com/614227")
public void testRealTimeNetworkQualityObservations() throws Exception {
mTestFramework = startCronetTestFramework();
TestExecutor testExecutor = new TestExecutor();
@@ -285,12 +282,19 @@ public class CronetUrlRequestContextTest extends CronetTestBase {
true, true, testExecutor);
mTestFramework.mCronetEngine.addRttListener(networkQualityListener);
mTestFramework.mCronetEngine.addThroughputListener(networkQualityListener);
- TestUrlRequestCallback callback = new TestUrlRequestCallback();
- UrlRequest urlRequest =
- mTestFramework.mCronetEngine.createRequest(mUrl, callback, callback.getExecutor());
- urlRequest.start();
- callback.blockForDone();
- testExecutor.runAllTasks();
+
+ // Throughput observation is posted to the network quality estimator and its observers
+ // after the UrlRequest is destroyed. Throughput observation corresponding to the first
+ // UrlRequest would post before the second UrlRequest starts.
xunjieli 2016/05/24 18:26:39 I don't quite understand the threading model. The
tbansal1 2016/05/25 00:02:22 Context on how NQE works: After the request comple
xunjieli 2016/05/25 20:37:50 I thought opening the conditional variable in onTh
tbansal1 2016/05/25 21:04:13 You are right, it makes sure that IO is completed.
xunjieli 2016/05/26 13:54:47 Ah, I see. I didn't realize TestExecutor runs task
tbansal1 2016/05/26 18:02:59 Acknowledged.
+ for (int i = 0; i < 2; ++i) {
+ TestUrlRequestCallback callback = new TestUrlRequestCallback();
+ UrlRequest urlRequest = mTestFramework.mCronetEngine.createRequest(
+ mUrl, callback, callback.getExecutor());
+ urlRequest.start();
+ callback.blockForDone();
+ testExecutor.runAllTasks();
+ }
+
assertTrue(networkQualityListener.rttObservationCount() > 0);
assertTrue(networkQualityListener.throughputObservationCount() > 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