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