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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 // NETWORK_QUALITY_OBSERVATION_SOURCE_QUIC | 340 // NETWORK_QUALITY_OBSERVATION_SOURCE_QUIC |
341 assertEquals(0, rttListener.rttObservationCount(2)); | 341 assertEquals(0, rttListener.rttObservationCount(2)); |
342 | 342 |
343 // Verify that the listeners were notified on the expected thread. | 343 // Verify that the listeners were notified on the expected thread. |
344 assertEquals(mNetworkQualityThread, rttListener.getThread()); | 344 assertEquals(mNetworkQualityThread, rttListener.getThread()); |
345 assertEquals(mNetworkQualityThread, throughputListener.getThread()); | 345 assertEquals(mNetworkQualityThread, throughputListener.getThread()); |
346 | 346 |
347 // Verify that effective connection type callback is received and | 347 // Verify that effective connection type callback is received and |
348 // effective connection type is correctly set. | 348 // effective connection type is correctly set. |
349 assertTrue(testFramework.mCronetEngine.getEffectiveConnectionType() | 349 assertTrue(testFramework.mCronetEngine.getEffectiveConnectionType() |
350 != EffectiveConnectionType.EFFECTIVE_CONNECTION_TYPE_UNKNOWN); | 350 != EffectiveConnectionType.TYPE_UNKNOWN); |
351 | 351 |
352 testFramework.mCronetEngine.shutdown(); | 352 testFramework.mCronetEngine.shutdown(); |
353 } | 353 } |
354 | 354 |
355 @SmallTest | 355 @SmallTest |
356 @Feature({"Cronet"}) | 356 @Feature({"Cronet"}) |
357 // TODO: Remove the annotation after fixing http://crbug.com/637979 & http:/
/crbug.com/637972 | 357 // TODO: Remove the annotation after fixing http://crbug.com/637979 & http:/
/crbug.com/637972 |
358 @OnlyRunNativeCronet | 358 @OnlyRunNativeCronet |
359 public void testShutdown() throws Exception { | 359 public void testShutdown() throws Exception { |
360 final CronetTestFramework testFramework = startCronetTestFramework(); | 360 final CronetTestFramework testFramework = startCronetTestFramework(); |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1466 TestUrlRequestCallback callback = new TestUrlRequestCallback(); | 1466 TestUrlRequestCallback callback = new TestUrlRequestCallback(); |
1467 URL requestUrl = | 1467 URL requestUrl = |
1468 new URL("http", resolverTestHostname, testUrl.getPort(), testUrl
.getFile()); | 1468 new URL("http", resolverTestHostname, testUrl.getPort(), testUrl
.getFile()); |
1469 UrlRequest.Builder urlRequestBuilder = new UrlRequest.Builder(requestUrl
.toString(), | 1469 UrlRequest.Builder urlRequestBuilder = new UrlRequest.Builder(requestUrl
.toString(), |
1470 callback, callback.getExecutor(), testFramework.mCronetEngine); | 1470 callback, callback.getExecutor(), testFramework.mCronetEngine); |
1471 urlRequestBuilder.build().start(); | 1471 urlRequestBuilder.build().start(); |
1472 callback.blockForDone(); | 1472 callback.blockForDone(); |
1473 assertEquals(200, callback.mResponseInfo.getHttpStatusCode()); | 1473 assertEquals(200, callback.mResponseInfo.getHttpStatusCode()); |
1474 } | 1474 } |
1475 } | 1475 } |
OLD | NEW |