| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.os.ConditionVariable; | 7 import android.os.ConditionVariable; |
| 8 import android.test.suitebuilder.annotation.LargeTest; | 8 import android.test.suitebuilder.annotation.LargeTest; |
| 9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.test.suitebuilder.annotation.SmallTest; |
| 10 | 10 |
| 11 import org.chromium.base.Log; | 11 import org.chromium.base.Log; |
| 12 import org.chromium.base.annotations.SuppressFBWarnings; | 12 import org.chromium.base.annotations.SuppressFBWarnings; |
| 13 import org.chromium.base.test.util.Feature; | 13 import org.chromium.base.test.util.Feature; |
| 14 import org.chromium.net.CronetTestBase.OnlyRunNativeCronet; | 14 import org.chromium.net.CronetTestBase.OnlyRunNativeCronet; |
| 15 import org.json.JSONObject; | 15 import org.json.JSONObject; |
| 16 | 16 |
| 17 import java.io.File; | 17 import java.io.File; |
| 18 import java.io.FileInputStream; | 18 import java.io.FileInputStream; |
| 19 import java.io.FileNotFoundException; | 19 import java.io.FileNotFoundException; |
| 20 import java.io.IOException; | 20 import java.io.IOException; |
| 21 import java.util.HashMap; | 21 import java.util.HashMap; |
| 22 import java.util.concurrent.Executors; | 22 import java.util.concurrent.Executors; |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * Tests making requests using QUIC. | 25 * Tests making requests using QUIC. |
| 26 */ | 26 */ |
| 27 public class QuicTest extends CronetTestBase { | 27 public class QuicTest extends CronetTestBase { |
| 28 private static final String TAG = "cr.QuicTest"; | 28 private static final String TAG = QuicTest.class.getSimpleName(); |
| 29 private CronetTestFramework mTestFramework; | 29 private CronetTestFramework mTestFramework; |
| 30 private CronetEngine.Builder mBuilder; | 30 private CronetEngine.Builder mBuilder; |
| 31 | 31 |
| 32 @Override | 32 @Override |
| 33 protected void setUp() throws Exception { | 33 protected void setUp() throws Exception { |
| 34 super.setUp(); | 34 super.setUp(); |
| 35 // Load library first, since we need the Quic test server's URL. | 35 // Load library first, since we need the Quic test server's URL. |
| 36 System.loadLibrary("cronet_tests"); | 36 System.loadLibrary("cronet_tests"); |
| 37 QuicTestServer.startQuicTestServer(getContext()); | 37 QuicTestServer.startQuicTestServer(getContext()); |
| 38 | 38 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 // that executor has finished posting the RTT observation to the RTT lis
teners. | 219 // that executor has finished posting the RTT observation to the RTT lis
teners. |
| 220 // NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST | 220 // NETWORK_QUALITY_OBSERVATION_SOURCE_URL_REQUEST |
| 221 assertTrue(rttListener.rttObservationCount(0) > 0); | 221 assertTrue(rttListener.rttObservationCount(0) > 0); |
| 222 | 222 |
| 223 // NETWORK_QUALITY_OBSERVATION_SOURCE_QUIC | 223 // NETWORK_QUALITY_OBSERVATION_SOURCE_QUIC |
| 224 assertTrue(rttListener.rttObservationCount(2) > 0); | 224 assertTrue(rttListener.rttObservationCount(2) > 0); |
| 225 | 225 |
| 226 mTestFramework.mCronetEngine.shutdown(); | 226 mTestFramework.mCronetEngine.shutdown(); |
| 227 } | 227 } |
| 228 } | 228 } |
| OLD | NEW |