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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 EXPECT_FALSE(params_.quic_disable_connection_pooling); | 248 EXPECT_FALSE(params_.quic_disable_connection_pooling); |
249 EXPECT_EQ(0.25f, params_.quic_load_server_info_timeout_srtt_multiplier); | 249 EXPECT_EQ(0.25f, params_.quic_load_server_info_timeout_srtt_multiplier); |
250 EXPECT_FALSE(params_.quic_enable_connection_racing); | 250 EXPECT_FALSE(params_.quic_enable_connection_racing); |
251 EXPECT_FALSE(params_.quic_enable_non_blocking_io); | 251 EXPECT_FALSE(params_.quic_enable_non_blocking_io); |
252 EXPECT_FALSE(params_.quic_disable_disk_cache); | 252 EXPECT_FALSE(params_.quic_disable_disk_cache); |
253 EXPECT_FALSE(params_.quic_prefer_aes); | 253 EXPECT_FALSE(params_.quic_prefer_aes); |
254 EXPECT_FALSE(params_.parse_alternative_services); | 254 EXPECT_FALSE(params_.parse_alternative_services); |
255 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); | 255 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); |
256 EXPECT_EQ(0, params_.quic_max_number_of_lossy_connections); | 256 EXPECT_EQ(0, params_.quic_max_number_of_lossy_connections); |
257 EXPECT_EQ(1.0f, params_.quic_packet_loss_threshold); | 257 EXPECT_EQ(1.0f, params_.quic_packet_loss_threshold); |
| 258 EXPECT_FALSE(params_.quic_delay_tcp_race); |
258 EXPECT_FALSE(params_.quic_close_sessions_on_ip_change); | 259 EXPECT_FALSE(params_.quic_close_sessions_on_ip_change); |
259 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, | 260 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, |
260 params_.quic_idle_connection_timeout_seconds); | 261 params_.quic_idle_connection_timeout_seconds); |
261 EXPECT_FALSE(params_.quic_disable_preconnect_if_0rtt); | 262 EXPECT_FALSE(params_.quic_disable_preconnect_if_0rtt); |
262 EXPECT_FALSE(params_.quic_migrate_sessions_on_network_change); | 263 EXPECT_FALSE(params_.quic_migrate_sessions_on_network_change); |
263 EXPECT_FALSE(params_.quic_migrate_sessions_early); | 264 EXPECT_FALSE(params_.quic_migrate_sessions_early); |
264 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); | 265 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); |
265 EXPECT_TRUE(params_.quic_host_whitelist.empty()); | 266 EXPECT_TRUE(params_.quic_host_whitelist.empty()); |
266 | 267 |
267 net::HttpNetworkSession::Params default_params; | 268 net::HttpNetworkSession::Params default_params; |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 std::map<std::string, std::string> field_trial_params; | 620 std::map<std::string, std::string> field_trial_params; |
620 field_trial_params["receive_buffer_size"] = "2097152"; | 621 field_trial_params["receive_buffer_size"] = "2097152"; |
621 variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params); | 622 variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params); |
622 base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled"); | 623 base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled"); |
623 | 624 |
624 ParseFieldTrials(); | 625 ParseFieldTrials(); |
625 | 626 |
626 EXPECT_EQ(2097152, params_.quic_socket_receive_buffer_size); | 627 EXPECT_EQ(2097152, params_.quic_socket_receive_buffer_size); |
627 } | 628 } |
628 | 629 |
| 630 TEST_F(NetworkSessionConfiguratorTest, QuicDelayTcpConnection) { |
| 631 std::map<std::string, std::string> field_trial_params; |
| 632 field_trial_params["delay_tcp_race"] = "true"; |
| 633 variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params); |
| 634 base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled"); |
| 635 |
| 636 ParseFieldTrials(); |
| 637 |
| 638 EXPECT_TRUE(params_.quic_delay_tcp_race); |
| 639 } |
| 640 |
629 TEST_F(NetworkSessionConfiguratorTest, QuicOriginsToForceQuicOn) { | 641 TEST_F(NetworkSessionConfiguratorTest, QuicOriginsToForceQuicOn) { |
630 base::CommandLine::ForCurrentProcess()->AppendSwitch("enable-quic"); | 642 base::CommandLine::ForCurrentProcess()->AppendSwitch("enable-quic"); |
631 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 643 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
632 "origin-to-force-quic-on", "www.example.com:443, www.example.org:443"); | 644 "origin-to-force-quic-on", "www.example.com:443, www.example.org:443"); |
633 | 645 |
634 ParseFieldTrialsAndCommandLine(); | 646 ParseFieldTrialsAndCommandLine(); |
635 | 647 |
636 EXPECT_EQ(2u, params_.origins_to_force_quic_on.size()); | 648 EXPECT_EQ(2u, params_.origins_to_force_quic_on.size()); |
637 EXPECT_TRUE( | 649 EXPECT_TRUE( |
638 ContainsKey(params_.origins_to_force_quic_on, | 650 ContainsKey(params_.origins_to_force_quic_on, |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, | 876 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, |
865 base::Unretained(this), "acc1")); | 877 base::Unretained(this), "acc1")); |
866 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); | 878 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); |
867 RunOnIOThreadBlocking(base::Bind( | 879 RunOnIOThreadBlocking(base::Bind( |
868 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, | 880 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, |
869 base::Unretained(this), "acc2")); | 881 base::Unretained(this), "acc2")); |
870 } | 882 } |
871 #endif | 883 #endif |
872 | 884 |
873 } // namespace test | 885 } // namespace test |
OLD | NEW |