| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.net; | 5 package org.chromium.net; |
| 6 | 6 |
| 7 import static org.chromium.base.CollectionUtil.newHashSet; | 7 import static org.chromium.base.CollectionUtil.newHashSet; |
| 8 | 8 |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.content.ContextWrapper; | 10 import android.content.ContextWrapper; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 UrlRequest urlRequest = | 263 UrlRequest urlRequest = |
| 264 mTestFramework.mCronetEngine.createRequest(mUrl, callback, callb
ack.getExecutor()); | 264 mTestFramework.mCronetEngine.createRequest(mUrl, callback, callb
ack.getExecutor()); |
| 265 urlRequest.start(); | 265 urlRequest.start(); |
| 266 callback.blockForDone(); | 266 callback.blockForDone(); |
| 267 testExecutor.runAllTasks(); | 267 testExecutor.runAllTasks(); |
| 268 assertEquals(0, networkQualityListener.rttObservationCount()); | 268 assertEquals(0, networkQualityListener.rttObservationCount()); |
| 269 assertEquals(0, networkQualityListener.throughputObservationCount()); | 269 assertEquals(0, networkQualityListener.throughputObservationCount()); |
| 270 mTestFramework.mCronetEngine.shutdown(); | 270 mTestFramework.mCronetEngine.shutdown(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 /* |
| 273 @SmallTest | 274 @SmallTest |
| 274 @Feature({"Cronet"}) | 275 @Feature({"Cronet"}) |
| 275 // TODO(xunjieli): Remove annotation after crbug.com/539519 is fixed. | 276 // TODO(xunjieli): Remove annotation after crbug.com/539519 is fixed. |
| 276 @SuppressWarnings("deprecation") | 277 @SuppressWarnings("deprecation") |
| 278 */ |
| 279 @FlakyTest(message = "http://crbug.com/614227") |
| 277 public void testRealTimeNetworkQualityObservations() throws Exception { | 280 public void testRealTimeNetworkQualityObservations() throws Exception { |
| 278 mTestFramework = startCronetTestFramework(); | 281 mTestFramework = startCronetTestFramework(); |
| 279 TestExecutor testExecutor = new TestExecutor(); | 282 TestExecutor testExecutor = new TestExecutor(); |
| 280 TestNetworkQualityListener networkQualityListener = new TestNetworkQuali
tyListener(); | 283 TestNetworkQualityListener networkQualityListener = new TestNetworkQuali
tyListener(); |
| 281 mTestFramework.mCronetEngine.enableNetworkQualityEstimatorForTesting( | 284 mTestFramework.mCronetEngine.enableNetworkQualityEstimatorForTesting( |
| 282 true, true, testExecutor); | 285 true, true, testExecutor); |
| 283 mTestFramework.mCronetEngine.addRttListener(networkQualityListener); | 286 mTestFramework.mCronetEngine.addRttListener(networkQualityListener); |
| 284 mTestFramework.mCronetEngine.addThroughputListener(networkQualityListene
r); | 287 mTestFramework.mCronetEngine.addThroughputListener(networkQualityListene
r); |
| 285 TestUrlRequestCallback callback = new TestUrlRequestCallback(); | 288 TestUrlRequestCallback callback = new TestUrlRequestCallback(); |
| 286 UrlRequest urlRequest = | 289 UrlRequest urlRequest = |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 } | 1149 } |
| 1147 }.start(); | 1150 }.start(); |
| 1148 otherThreadDone.block(); | 1151 otherThreadDone.block(); |
| 1149 builder.build().shutdown(); | 1152 builder.build().shutdown(); |
| 1150 uiThreadDone.open(); | 1153 uiThreadDone.open(); |
| 1151 } | 1154 } |
| 1152 }); | 1155 }); |
| 1153 assertTrue(uiThreadDone.block(1000)); | 1156 assertTrue(uiThreadDone.block(1000)); |
| 1154 } | 1157 } |
| 1155 } | 1158 } |
| OLD | NEW |