| 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 android.content.Context; | 7 import android.content.Context; |
| 8 import android.content.ContextWrapper; | 8 import android.content.ContextWrapper; |
| 9 import android.os.ConditionVariable; | 9 import android.os.ConditionVariable; |
| 10 import android.os.Handler; | 10 import android.os.Handler; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 // NETWORK_QUALITY_OBSERVATION_SOURCE_TCP | 319 // NETWORK_QUALITY_OBSERVATION_SOURCE_TCP |
| 320 assertTrue(rttListener.rttObservationCount(1) > 0); | 320 assertTrue(rttListener.rttObservationCount(1) > 0); |
| 321 | 321 |
| 322 // NETWORK_QUALITY_OBSERVATION_SOURCE_QUIC | 322 // NETWORK_QUALITY_OBSERVATION_SOURCE_QUIC |
| 323 assertEquals(0, rttListener.rttObservationCount(2)); | 323 assertEquals(0, rttListener.rttObservationCount(2)); |
| 324 | 324 |
| 325 // Verify that the listeners were notified on the expected thread. | 325 // Verify that the listeners were notified on the expected thread. |
| 326 assertEquals(mNetworkQualityThread, rttListener.getThread()); | 326 assertEquals(mNetworkQualityThread, rttListener.getThread()); |
| 327 assertEquals(mNetworkQualityThread, throughputListener.getThread()); | 327 assertEquals(mNetworkQualityThread, throughputListener.getThread()); |
| 328 | 328 |
| 329 // Verify that effective connection type callback is received and |
| 330 // effective connection type is correctly set. |
| 331 assertTrue(mTestFramework.mCronetEngine.getEffectiveConnectionType() |
| 332 != EffectiveConnectionType.EFFECTIVE_CONNECTION_TYPE_UNKNOWN); |
| 333 |
| 329 mTestFramework.mCronetEngine.shutdown(); | 334 mTestFramework.mCronetEngine.shutdown(); |
| 330 } | 335 } |
| 331 | 336 |
| 332 | 337 |
| 333 | 338 |
| 334 /** | 339 /** |
| 335 @SmallTest | 340 @SmallTest |
| 336 @Feature({"Cronet"}) | 341 @Feature({"Cronet"}) |
| 337 https://crbug.com/596929 | 342 https://crbug.com/596929 |
| 338 */ | 343 */ |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 } | 1118 } |
| 1114 }.start(); | 1119 }.start(); |
| 1115 otherThreadDone.block(); | 1120 otherThreadDone.block(); |
| 1116 builder.build().shutdown(); | 1121 builder.build().shutdown(); |
| 1117 uiThreadDone.open(); | 1122 uiThreadDone.open(); |
| 1118 } | 1123 } |
| 1119 }); | 1124 }); |
| 1120 assertTrue(uiThreadDone.block(1000)); | 1125 assertTrue(uiThreadDone.block(1000)); |
| 1121 } | 1126 } |
| 1122 } | 1127 } |
| OLD | NEW |