| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/io_thread.h" | 6 #include "chrome/browser/io_thread.h" |
| 7 #include "net/http/http_network_session.h" | 7 #include "net/http/http_network_session.h" |
| 8 #include "net/http/http_server_properties_impl.h" | 8 #include "net/http/http_server_properties_impl.h" |
| 9 #include "net/quic/quic_protocol.h" | 9 #include "net/quic/quic_protocol.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 EXPECT_EQ(1350u, params.quic_max_packet_length); | 128 EXPECT_EQ(1350u, params.quic_max_packet_length); |
| 129 EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold); | 129 EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold); |
| 130 EXPECT_EQ(default_params.quic_supported_versions, | 130 EXPECT_EQ(default_params.quic_supported_versions, |
| 131 params.quic_supported_versions); | 131 params.quic_supported_versions); |
| 132 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); | 132 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); |
| 133 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); | 133 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); |
| 134 EXPECT_FALSE(params.quic_disable_connection_pooling); | 134 EXPECT_FALSE(params.quic_disable_connection_pooling); |
| 135 EXPECT_EQ(0, params.quic_load_server_info_timeout_ms); | 135 EXPECT_EQ(0, params.quic_load_server_info_timeout_ms); |
| 136 EXPECT_FALSE(params.quic_disable_loading_server_info_for_new_servers); | 136 EXPECT_FALSE(params.quic_disable_loading_server_info_for_new_servers); |
| 137 EXPECT_EQ(0.0f, params.quic_load_server_info_timeout_srtt_multiplier); | 137 EXPECT_EQ(0.0f, params.quic_load_server_info_timeout_srtt_multiplier); |
| 138 EXPECT_FALSE(params.quic_enable_truncated_connection_ids); |
| 138 } | 139 } |
| 139 | 140 |
| 140 TEST_F(IOThreadTest, EnableQuicFromCommandLine) { | 141 TEST_F(IOThreadTest, EnableQuicFromCommandLine) { |
| 141 command_line_.AppendSwitch("enable-quic"); | 142 command_line_.AppendSwitch("enable-quic"); |
| 142 | 143 |
| 143 ConfigureQuicGlobals(); | 144 ConfigureQuicGlobals(); |
| 144 net::HttpNetworkSession::Params params; | 145 net::HttpNetworkSession::Params params; |
| 145 InitializeNetworkSessionParams(¶ms); | 146 InitializeNetworkSessionParams(¶ms); |
| 146 EXPECT_TRUE(params.enable_quic); | 147 EXPECT_TRUE(params.enable_quic); |
| 147 EXPECT_FALSE(params.quic_disable_loading_server_info_for_new_servers); | 148 EXPECT_FALSE(params.quic_disable_loading_server_info_for_new_servers); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 320 |
| 320 TEST_F(IOThreadTest, QuicLoadServerInfoTimeToSmoothedRttFromFieldTrialParams) { | 321 TEST_F(IOThreadTest, QuicLoadServerInfoTimeToSmoothedRttFromFieldTrialParams) { |
| 321 field_trial_group_ = "Enabled"; | 322 field_trial_group_ = "Enabled"; |
| 322 field_trial_params_["load_server_info_time_to_srtt"] = "0.5"; | 323 field_trial_params_["load_server_info_time_to_srtt"] = "0.5"; |
| 323 ConfigureQuicGlobals(); | 324 ConfigureQuicGlobals(); |
| 324 net::HttpNetworkSession::Params params; | 325 net::HttpNetworkSession::Params params; |
| 325 InitializeNetworkSessionParams(¶ms); | 326 InitializeNetworkSessionParams(¶ms); |
| 326 EXPECT_EQ(0.5f, params.quic_load_server_info_timeout_srtt_multiplier); | 327 EXPECT_EQ(0.5f, params.quic_load_server_info_timeout_srtt_multiplier); |
| 327 } | 328 } |
| 328 | 329 |
| 330 TEST_F(IOThreadTest, QuicDisableTruncatedConnectionIds) { |
| 331 field_trial_group_ = "Enabled"; |
| 332 field_trial_params_["enable_truncated_connection_ids"] = "true"; |
| 333 ConfigureQuicGlobals(); |
| 334 net::HttpNetworkSession::Params params; |
| 335 InitializeNetworkSessionParams(¶ms); |
| 336 EXPECT_TRUE(params.quic_enable_truncated_connection_ids); |
| 337 } |
| 338 |
| 329 TEST_F(IOThreadTest, | 339 TEST_F(IOThreadTest, |
| 330 AlternateProtocolProbabilityThresholdFromFlag) { | 340 AlternateProtocolProbabilityThresholdFromFlag) { |
| 331 command_line_.AppendSwitchASCII("alternate-protocol-probability-threshold", | 341 command_line_.AppendSwitchASCII("alternate-protocol-probability-threshold", |
| 332 ".5"); | 342 ".5"); |
| 333 | 343 |
| 334 ConfigureQuicGlobals(); | 344 ConfigureQuicGlobals(); |
| 335 net::HttpNetworkSession::Params params; | 345 net::HttpNetworkSession::Params params; |
| 336 InitializeNetworkSessionParams(¶ms); | 346 InitializeNetworkSessionParams(¶ms); |
| 337 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); | 347 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); |
| 338 } | 348 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 352 field_trial_group_ = "Enabled"; | 362 field_trial_group_ = "Enabled"; |
| 353 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; | 363 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; |
| 354 | 364 |
| 355 ConfigureQuicGlobals(); | 365 ConfigureQuicGlobals(); |
| 356 net::HttpNetworkSession::Params params; | 366 net::HttpNetworkSession::Params params; |
| 357 InitializeNetworkSessionParams(¶ms); | 367 InitializeNetworkSessionParams(¶ms); |
| 358 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); | 368 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); |
| 359 } | 369 } |
| 360 | 370 |
| 361 } // namespace test | 371 } // namespace test |
| OLD | NEW |