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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 EXPECT_FALSE(params_.quic_disable_connection_pooling); | 244 EXPECT_FALSE(params_.quic_disable_connection_pooling); |
245 EXPECT_EQ(0.25f, params_.quic_load_server_info_timeout_srtt_multiplier); | 245 EXPECT_EQ(0.25f, params_.quic_load_server_info_timeout_srtt_multiplier); |
246 EXPECT_FALSE(params_.quic_enable_connection_racing); | 246 EXPECT_FALSE(params_.quic_enable_connection_racing); |
247 EXPECT_FALSE(params_.quic_enable_non_blocking_io); | 247 EXPECT_FALSE(params_.quic_enable_non_blocking_io); |
248 EXPECT_FALSE(params_.quic_disable_disk_cache); | 248 EXPECT_FALSE(params_.quic_disable_disk_cache); |
249 EXPECT_FALSE(params_.quic_prefer_aes); | 249 EXPECT_FALSE(params_.quic_prefer_aes); |
250 EXPECT_TRUE(params_.parse_alternative_services); | 250 EXPECT_TRUE(params_.parse_alternative_services); |
251 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); | 251 EXPECT_FALSE(params_.enable_alternative_service_with_different_host); |
252 EXPECT_EQ(0, params_.quic_max_number_of_lossy_connections); | 252 EXPECT_EQ(0, params_.quic_max_number_of_lossy_connections); |
253 EXPECT_EQ(1.0f, params_.quic_packet_loss_threshold); | 253 EXPECT_EQ(1.0f, params_.quic_packet_loss_threshold); |
| 254 EXPECT_FALSE(params_.quic_delay_tcp_race); |
254 EXPECT_FALSE(params_.quic_close_sessions_on_ip_change); | 255 EXPECT_FALSE(params_.quic_close_sessions_on_ip_change); |
255 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, | 256 EXPECT_EQ(net::kIdleConnectionTimeoutSeconds, |
256 params_.quic_idle_connection_timeout_seconds); | 257 params_.quic_idle_connection_timeout_seconds); |
257 EXPECT_FALSE(params_.quic_disable_preconnect_if_0rtt); | 258 EXPECT_FALSE(params_.quic_disable_preconnect_if_0rtt); |
258 EXPECT_FALSE(params_.quic_migrate_sessions_on_network_change); | 259 EXPECT_FALSE(params_.quic_migrate_sessions_on_network_change); |
259 EXPECT_FALSE(params_.quic_migrate_sessions_early); | 260 EXPECT_FALSE(params_.quic_migrate_sessions_early); |
260 EXPECT_TRUE(params_.quic_host_whitelist.empty()); | 261 EXPECT_TRUE(params_.quic_host_whitelist.empty()); |
261 | 262 |
262 net::HttpNetworkSession::Params default_params; | 263 net::HttpNetworkSession::Params default_params; |
263 EXPECT_EQ(default_params.quic_supported_versions, | 264 EXPECT_EQ(default_params.quic_supported_versions, |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 std::map<std::string, std::string> field_trial_params; | 570 std::map<std::string, std::string> field_trial_params; |
570 field_trial_params["receive_buffer_size"] = "2097152"; | 571 field_trial_params["receive_buffer_size"] = "2097152"; |
571 variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params); | 572 variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params); |
572 base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled"); | 573 base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled"); |
573 | 574 |
574 ParseFieldTrials(); | 575 ParseFieldTrials(); |
575 | 576 |
576 EXPECT_EQ(2097152, params_.quic_socket_receive_buffer_size); | 577 EXPECT_EQ(2097152, params_.quic_socket_receive_buffer_size); |
577 } | 578 } |
578 | 579 |
| 580 TEST_F(NetworkSessionConfiguratorTest, QuicDelayTcpConnection) { |
| 581 std::map<std::string, std::string> field_trial_params; |
| 582 field_trial_params["delay_tcp_race"] = "false"; |
| 583 variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params); |
| 584 base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled"); |
| 585 |
| 586 ParseFieldTrials(); |
| 587 |
| 588 EXPECT_FALSE(params_.quic_delay_tcp_race); |
| 589 } |
| 590 |
579 TEST_F(NetworkSessionConfiguratorTest, QuicOriginsToForceQuicOn) { | 591 TEST_F(NetworkSessionConfiguratorTest, QuicOriginsToForceQuicOn) { |
580 base::CommandLine::ForCurrentProcess()->AppendSwitch("enable-quic"); | 592 base::CommandLine::ForCurrentProcess()->AppendSwitch("enable-quic"); |
581 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 593 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
582 "origin-to-force-quic-on", "www.example.com:443, www.example.org:443"); | 594 "origin-to-force-quic-on", "www.example.com:443, www.example.org:443"); |
583 | 595 |
584 ParseFieldTrialsAndCommandLine(); | 596 ParseFieldTrialsAndCommandLine(); |
585 | 597 |
586 EXPECT_EQ(2u, params_.origins_to_force_quic_on.size()); | 598 EXPECT_EQ(2u, params_.origins_to_force_quic_on.size()); |
587 EXPECT_TRUE( | 599 EXPECT_TRUE( |
588 ContainsKey(params_.origins_to_force_quic_on, | 600 ContainsKey(params_.origins_to_force_quic_on, |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, | 826 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, |
815 base::Unretained(this), "acc1")); | 827 base::Unretained(this), "acc1")); |
816 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); | 828 pref_service()->SetString(prefs::kAuthAndroidNegotiateAccountType, "acc2"); |
817 RunOnIOThreadBlocking(base::Bind( | 829 RunOnIOThreadBlocking(base::Bind( |
818 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, | 830 &IOThreadTestWithIOThreadObject::CheckAuthAndroidNegoitateAccountType, |
819 base::Unretained(this), "acc2")); | 831 base::Unretained(this), "acc2")); |
820 } | 832 } |
821 #endif | 833 #endif |
822 | 834 |
823 } // namespace test | 835 } // namespace test |
OLD | NEW |