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

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

Issue 2470903002: Add default implementation of experimental methods (Closed)
Patch Set: Addressed Paul's comments Created 4 years, 1 month 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
« no previous file with comments | « components/cronet/android/java/src/org/chromium/net/impl/JavaCronetEngine.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 assertEquals(mNetworkQualityThread, throughputListener.getThread()); 339 assertEquals(mNetworkQualityThread, throughputListener.getThread());
340 340
341 // Verify that effective connection type callback is received and 341 // Verify that effective connection type callback is received and
342 // effective connection type is correctly set. 342 // effective connection type is correctly set.
343 assertTrue(testFramework.mCronetEngine.getEffectiveConnectionType() 343 assertTrue(testFramework.mCronetEngine.getEffectiveConnectionType()
344 != EffectiveConnectionType.TYPE_UNKNOWN); 344 != EffectiveConnectionType.TYPE_UNKNOWN);
345 345
346 // Verify that the HTTP RTT, transport RTT and downstream throughput 346 // Verify that the HTTP RTT, transport RTT and downstream throughput
347 // estimates are available. 347 // estimates are available.
348 if (testFramework.mCronetEngine.getEffectiveConnectionType() 348 if (testFramework.mCronetEngine.getEffectiveConnectionType()
349 != EffectiveConnectionType.TYPE_OFFLINE) { 349 != ExperimentalCronetEngine.EFFECTIVE_CONNECTION_TYPE_OFFLINE) {
350 assertTrue(testFramework.mCronetEngine.getHttpRttMs() > 0); 350 assertTrue(testFramework.mCronetEngine.getHttpRttMs() > 0);
351 assertTrue(testFramework.mCronetEngine.getTransportRttMs() > 0); 351 assertTrue(testFramework.mCronetEngine.getTransportRttMs() > 0);
352 assertTrue(testFramework.mCronetEngine.getDownstreamThroughputKbps() > 0); 352 assertTrue(testFramework.mCronetEngine.getDownstreamThroughputKbps() > 0);
353 } else { 353 } else {
354 assertEquals(RttThroughputValues.INVALID_RTT_THROUGHPUT, 354 assertEquals(RttThroughputValues.INVALID_RTT_THROUGHPUT,
355 testFramework.mCronetEngine.getHttpRttMs()); 355 testFramework.mCronetEngine.getHttpRttMs());
356 assertEquals(RttThroughputValues.INVALID_RTT_THROUGHPUT, 356 assertEquals(RttThroughputValues.INVALID_RTT_THROUGHPUT,
357 testFramework.mCronetEngine.getTransportRttMs()); 357 testFramework.mCronetEngine.getTransportRttMs());
358 assertEquals(RttThroughputValues.INVALID_RTT_THROUGHPUT, 358 assertEquals(RttThroughputValues.INVALID_RTT_THROUGHPUT,
359 testFramework.mCronetEngine.getDownstreamThroughputKbps()); 359 testFramework.mCronetEngine.getDownstreamThroughputKbps());
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 TestUrlRequestCallback callback = new TestUrlRequestCallback(); 1482 TestUrlRequestCallback callback = new TestUrlRequestCallback();
1483 URL requestUrl = 1483 URL requestUrl =
1484 new URL("http", resolverTestHostname, testUrl.getPort(), testUrl .getFile()); 1484 new URL("http", resolverTestHostname, testUrl.getPort(), testUrl .getFile());
1485 UrlRequest.Builder urlRequestBuilder = testFramework.mCronetEngine.newUr lRequestBuilder( 1485 UrlRequest.Builder urlRequestBuilder = testFramework.mCronetEngine.newUr lRequestBuilder(
1486 requestUrl.toString(), callback, callback.getExecutor()); 1486 requestUrl.toString(), callback, callback.getExecutor());
1487 urlRequestBuilder.build().start(); 1487 urlRequestBuilder.build().start();
1488 callback.blockForDone(); 1488 callback.blockForDone();
1489 assertEquals(200, callback.mResponseInfo.getHttpStatusCode()); 1489 assertEquals(200, callback.mResponseInfo.getHttpStatusCode());
1490 } 1490 }
1491 } 1491 }
OLDNEW
« no previous file with comments | « components/cronet/android/java/src/org/chromium/net/impl/JavaCronetEngine.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698