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

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

Issue 2341443002: [Cronet] Strip prefix of EFFECTIVE_CONNECTION_TYPE to just TYPE_blah (Closed)
Patch Set: fix tests Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698