OLD | NEW |
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 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "base/prefs/pref_registry_simple.h" | 8 #include "base/prefs/pref_registry_simple.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 EXPECT_FALSE(params.quic_disable_disk_cache); | 226 EXPECT_FALSE(params.quic_disable_disk_cache); |
227 EXPECT_FALSE(params.quic_prefer_aes); | 227 EXPECT_FALSE(params.quic_prefer_aes); |
228 EXPECT_FALSE(params.use_alternative_services); | 228 EXPECT_FALSE(params.use_alternative_services); |
229 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections); | 229 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections); |
230 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold); | 230 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold); |
231 EXPECT_FALSE(params.quic_delay_tcp_race); | 231 EXPECT_FALSE(params.quic_delay_tcp_race); |
232 EXPECT_FALSE(params.quic_close_sessions_on_ip_change); | 232 EXPECT_FALSE(params.quic_close_sessions_on_ip_change); |
233 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, | 233 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, |
234 params.quic_idle_connection_timeout_seconds); | 234 params.quic_idle_connection_timeout_seconds); |
235 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt); | 235 EXPECT_FALSE(params.quic_disable_preconnect_if_0rtt); |
| 236 EXPECT_FALSE(params.quic_migrate_sessions_on_net_change); |
236 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); | 237 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); |
237 } | 238 } |
238 | 239 |
239 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { | 240 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { |
240 const struct { | 241 const struct { |
241 std::string field_trial_group_name; | 242 std::string field_trial_group_name; |
242 bool expect_enable_quic; | 243 bool expect_enable_quic; |
243 } tests[] = { | 244 } tests[] = { |
244 { | 245 { |
245 std::string(), false, | 246 std::string(), false, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 341 |
341 TEST_F(IOThreadTest, QuicDisablePreConnectIfZeroRtt) { | 342 TEST_F(IOThreadTest, QuicDisablePreConnectIfZeroRtt) { |
342 field_trial_group_ = "Enabled"; | 343 field_trial_group_ = "Enabled"; |
343 field_trial_params_["disable_preconnect_if_0rtt"] = "true"; | 344 field_trial_params_["disable_preconnect_if_0rtt"] = "true"; |
344 ConfigureQuicGlobals(); | 345 ConfigureQuicGlobals(); |
345 net::HttpNetworkSession::Params params; | 346 net::HttpNetworkSession::Params params; |
346 InitializeNetworkSessionParams(¶ms); | 347 InitializeNetworkSessionParams(¶ms); |
347 EXPECT_TRUE(params.quic_disable_preconnect_if_0rtt); | 348 EXPECT_TRUE(params.quic_disable_preconnect_if_0rtt); |
348 } | 349 } |
349 | 350 |
| 351 TEST_F(IOThreadTest, QuicMigrateSessionsOnNetworkChangeFromFieldTrialParams) { |
| 352 field_trial_group_ = "Enabled"; |
| 353 field_trial_params_["migrate_sessions_on_network_change"] = "true"; |
| 354 ConfigureQuicGlobals(); |
| 355 net::HttpNetworkSession::Params params; |
| 356 InitializeNetworkSessionParams(¶ms); |
| 357 EXPECT_TRUE(params.quic_migrate_sessions_on_network_change); |
| 358 |
350 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) { | 359 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) { |
351 field_trial_group_ = "Enabled"; | 360 field_trial_group_ = "Enabled"; |
352 field_trial_params_["max_packet_length"] = "1450"; | 361 field_trial_params_["max_packet_length"] = "1450"; |
353 | 362 |
354 ConfigureQuicGlobals(); | 363 ConfigureQuicGlobals(); |
355 net::HttpNetworkSession::Params params; | 364 net::HttpNetworkSession::Params params; |
356 InitializeNetworkSessionParams(¶ms); | 365 InitializeNetworkSessionParams(¶ms); |
357 EXPECT_EQ(1450u, params.quic_max_packet_length); | 366 EXPECT_EQ(1450u, params.quic_max_packet_length); |
358 } | 367 } |
359 | 368 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, | 752 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, |
744 base::Unretained(this), "acc1")); | 753 base::Unretained(this), "acc1")); |
745 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); | 754 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); |
746 RunOnIOThreadBlocking(base::Bind( | 755 RunOnIOThreadBlocking(base::Bind( |
747 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, | 756 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, |
748 base::Unretained(this), "acc2")); | 757 base::Unretained(this), "acc2")); |
749 } | 758 } |
750 #endif | 759 #endif |
751 | 760 |
752 } // namespace test | 761 } // namespace test |
OLD | NEW |