| 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 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 mBuilder.enableQuic(true).enableNetworkQualityEstimator(true); | 40 mBuilder.enableQuic(true).enableNetworkQualityEstimator(true); |
| 41 mBuilder.addQuicHint(QuicTestServer.getServerHost(), QuicTestServer.getS
erverPort(), | 41 mBuilder.addQuicHint(QuicTestServer.getServerHost(), QuicTestServer.getS
erverPort(), |
| 42 QuicTestServer.getServerPort()); | 42 QuicTestServer.getServerPort()); |
| 43 | 43 |
| 44 // TODO(mgersh): Enable connection migration once it works, see http://c
rbug.com/634910 | 44 // TODO(mgersh): Enable connection migration once it works, see http://c
rbug.com/634910 |
| 45 JSONObject quicParams = new JSONObject() | 45 JSONObject quicParams = new JSONObject() |
| 46 .put("connection_options", "PACE,IW10,FO
O,DEADBEEF") | 46 .put("connection_options", "PACE,IW10,FO
O,DEADBEEF") |
| 47 .put("host_whitelist", "test.example.com
") | 47 .put("host_whitelist", "test.example.com
") |
| 48 .put("max_server_configs_stored_in_prope
rties", 2) | 48 .put("max_server_configs_stored_in_prope
rties", 2) |
| 49 .put("delay_tcp_race", true) | 49 .put("delay_tcp_race", true) |
| 50 .put("max_number_of_lossy_connections",
10) | |
| 51 .put("packet_loss_threshold", 0.5) | |
| 52 .put("idle_connection_timeout_seconds",
300) | 50 .put("idle_connection_timeout_seconds",
300) |
| 53 .put("close_sessions_on_ip_change", fals
e) | 51 .put("close_sessions_on_ip_change", fals
e) |
| 54 .put("migrate_sessions_on_network_change
", false) | 52 .put("migrate_sessions_on_network_change
", false) |
| 55 .put("migrate_sessions_early", false) | 53 .put("migrate_sessions_early", false) |
| 56 .put("race_cert_verification", true); | 54 .put("race_cert_verification", true); |
| 57 JSONObject hostResolverParams = CronetTestUtil.generateHostResolverRules
(); | 55 JSONObject hostResolverParams = CronetTestUtil.generateHostResolverRules
(); |
| 58 JSONObject experimentalOptions = new JSONObject() | 56 JSONObject experimentalOptions = new JSONObject() |
| 59 .put("QUIC", quicParams) | 57 .put("QUIC", quicParams) |
| 60 .put("HostResolverRules", hostR
esolverParams); | 58 .put("HostResolverRules", hostR
esolverParams); |
| 61 mBuilder.setExperimentalOptions(experimentalOptions.toString()); | 59 mBuilder.setExperimentalOptions(experimentalOptions.toString()); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 assertTrue(rttListener.rttObservationCount(2) > 0); | 225 assertTrue(rttListener.rttObservationCount(2) > 0); |
| 228 | 226 |
| 229 // Verify that effective connection type callback is received and | 227 // Verify that effective connection type callback is received and |
| 230 // effective connection type is correctly set. | 228 // effective connection type is correctly set. |
| 231 assertTrue(mTestFramework.mCronetEngine.getEffectiveConnectionType() | 229 assertTrue(mTestFramework.mCronetEngine.getEffectiveConnectionType() |
| 232 != EffectiveConnectionType.EFFECTIVE_CONNECTION_TYPE_UNKNOWN); | 230 != EffectiveConnectionType.EFFECTIVE_CONNECTION_TYPE_UNKNOWN); |
| 233 | 231 |
| 234 mTestFramework.mCronetEngine.shutdown(); | 232 mTestFramework.mCronetEngine.shutdown(); |
| 235 } | 233 } |
| 236 } | 234 } |
| OLD | NEW |