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

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

Issue 2223773003: Expose effective connection type to Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes based on https://codereview.chromium.org/2210633002/ Created 4 years, 4 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698