| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 InitializeNetworkSessionParams(¶ms); | 125 InitializeNetworkSessionParams(¶ms); |
| 126 EXPECT_TRUE(params.enable_quic); | 126 EXPECT_TRUE(params.enable_quic); |
| 127 EXPECT_EQ(1350u, params.quic_max_packet_length); | 127 EXPECT_EQ(1350u, params.quic_max_packet_length); |
| 128 EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold); | 128 EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold); |
| 129 EXPECT_EQ(default_params.quic_supported_versions, | 129 EXPECT_EQ(default_params.quic_supported_versions, |
| 130 params.quic_supported_versions); | 130 params.quic_supported_versions); |
| 131 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); | 131 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); |
| 132 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); | 132 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); |
| 133 EXPECT_FALSE(params.quic_disable_connection_pooling); | 133 EXPECT_FALSE(params.quic_disable_connection_pooling); |
| 134 EXPECT_EQ(0, params.quic_load_server_info_timeout_ms); | 134 EXPECT_EQ(0, params.quic_load_server_info_timeout_ms); |
| 135 EXPECT_FALSE(params.quic_disable_loading_server_info_for_new_servers); | |
| 136 EXPECT_EQ(0.0f, params.quic_load_server_info_timeout_srtt_multiplier); | 135 EXPECT_EQ(0.0f, params.quic_load_server_info_timeout_srtt_multiplier); |
| 137 EXPECT_FALSE(params.quic_enable_truncated_connection_ids); | 136 EXPECT_FALSE(params.quic_enable_truncated_connection_ids); |
| 138 } | 137 } |
| 139 | 138 |
| 140 TEST_F(IOThreadTest, EnableQuicFromCommandLine) { | 139 TEST_F(IOThreadTest, EnableQuicFromCommandLine) { |
| 141 command_line_.AppendSwitch("enable-quic"); | 140 command_line_.AppendSwitch("enable-quic"); |
| 142 | 141 |
| 143 ConfigureQuicGlobals(); | 142 ConfigureQuicGlobals(); |
| 144 net::HttpNetworkSession::Params params; | 143 net::HttpNetworkSession::Params params; |
| 145 InitializeNetworkSessionParams(¶ms); | 144 InitializeNetworkSessionParams(¶ms); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 271 |
| 273 TEST_F(IOThreadTest, QuicLoadServerInfoTimeoutFromFieldTrialParams) { | 272 TEST_F(IOThreadTest, QuicLoadServerInfoTimeoutFromFieldTrialParams) { |
| 274 field_trial_group_ = "Enabled"; | 273 field_trial_group_ = "Enabled"; |
| 275 field_trial_params_["load_server_info_timeout"] = "50"; | 274 field_trial_params_["load_server_info_timeout"] = "50"; |
| 276 ConfigureQuicGlobals(); | 275 ConfigureQuicGlobals(); |
| 277 net::HttpNetworkSession::Params params; | 276 net::HttpNetworkSession::Params params; |
| 278 InitializeNetworkSessionParams(¶ms); | 277 InitializeNetworkSessionParams(¶ms); |
| 279 EXPECT_EQ(50, params.quic_load_server_info_timeout_ms); | 278 EXPECT_EQ(50, params.quic_load_server_info_timeout_ms); |
| 280 } | 279 } |
| 281 | 280 |
| 282 TEST_F(IOThreadTest, QuicDisableLoadingServerInfoForNewServers) { | |
| 283 field_trial_group_ = "Enabled"; | |
| 284 field_trial_params_["disable_loading_server_info_for_new_servers"] = "true"; | |
| 285 ConfigureQuicGlobals(); | |
| 286 net::HttpNetworkSession::Params params; | |
| 287 InitializeNetworkSessionParams(¶ms); | |
| 288 EXPECT_TRUE(params.quic_disable_loading_server_info_for_new_servers); | |
| 289 } | |
| 290 | |
| 291 TEST_F(IOThreadTest, QuicLoadServerInfoTimeToSmoothedRttFromFieldTrialParams) { | 281 TEST_F(IOThreadTest, QuicLoadServerInfoTimeToSmoothedRttFromFieldTrialParams) { |
| 292 field_trial_group_ = "Enabled"; | 282 field_trial_group_ = "Enabled"; |
| 293 field_trial_params_["load_server_info_time_to_srtt"] = "0.5"; | 283 field_trial_params_["load_server_info_time_to_srtt"] = "0.5"; |
| 294 ConfigureQuicGlobals(); | 284 ConfigureQuicGlobals(); |
| 295 net::HttpNetworkSession::Params params; | 285 net::HttpNetworkSession::Params params; |
| 296 InitializeNetworkSessionParams(¶ms); | 286 InitializeNetworkSessionParams(¶ms); |
| 297 EXPECT_EQ(0.5f, params.quic_load_server_info_timeout_srtt_multiplier); | 287 EXPECT_EQ(0.5f, params.quic_load_server_info_timeout_srtt_multiplier); |
| 298 } | 288 } |
| 299 | 289 |
| 300 TEST_F(IOThreadTest, QuicDisableTruncatedConnectionIds) { | 290 TEST_F(IOThreadTest, QuicDisableTruncatedConnectionIds) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 field_trial_group_ = "Enabled"; | 322 field_trial_group_ = "Enabled"; |
| 333 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; | 323 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; |
| 334 | 324 |
| 335 ConfigureQuicGlobals(); | 325 ConfigureQuicGlobals(); |
| 336 net::HttpNetworkSession::Params params; | 326 net::HttpNetworkSession::Params params; |
| 337 InitializeNetworkSessionParams(¶ms); | 327 InitializeNetworkSessionParams(¶ms); |
| 338 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); | 328 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); |
| 339 } | 329 } |
| 340 | 330 |
| 341 } // namespace test | 331 } // namespace test |
| OLD | NEW |