| 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 "base/metrics/field_trial.h" | 6 #include "base/metrics/field_trial.h" |
| 7 #include "base/test/mock_entropy_provider.h" | 7 #include "base/test/mock_entropy_provider.h" |
| 8 #include "chrome/browser/io_thread.h" | 8 #include "chrome/browser/io_thread.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" | 10 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 | 194 |
| 195 TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) { | 195 TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) { |
| 196 field_trial_group_ = "Enabled"; | 196 field_trial_group_ = "Enabled"; |
| 197 | 197 |
| 198 ConfigureQuicGlobals(); | 198 ConfigureQuicGlobals(); |
| 199 net::HttpNetworkSession::Params default_params; | 199 net::HttpNetworkSession::Params default_params; |
| 200 net::HttpNetworkSession::Params params; | 200 net::HttpNetworkSession::Params params; |
| 201 InitializeNetworkSessionParams(¶ms); | 201 InitializeNetworkSessionParams(¶ms); |
| 202 EXPECT_TRUE(params.enable_quic); | 202 EXPECT_TRUE(params.enable_quic); |
| 203 EXPECT_FALSE(params.disable_insecure_quic); |
| 203 EXPECT_TRUE(params.enable_quic_for_proxies); | 204 EXPECT_TRUE(params.enable_quic_for_proxies); |
| 204 EXPECT_EQ(1350u, params.quic_max_packet_length); | 205 EXPECT_EQ(1350u, params.quic_max_packet_length); |
| 205 EXPECT_EQ(1.0, params.alternative_service_probability_threshold); | 206 EXPECT_EQ(1.0, params.alternative_service_probability_threshold); |
| 206 EXPECT_EQ(default_params.quic_supported_versions, | 207 EXPECT_EQ(default_params.quic_supported_versions, |
| 207 params.quic_supported_versions); | 208 params.quic_supported_versions); |
| 208 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); | 209 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); |
| 209 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); | 210 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); |
| 210 EXPECT_FALSE(params.quic_disable_connection_pooling); | 211 EXPECT_FALSE(params.quic_disable_connection_pooling); |
| 211 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier); | 212 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier); |
| 212 EXPECT_FALSE(params.quic_enable_connection_racing); | 213 EXPECT_FALSE(params.quic_enable_connection_racing); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 command_line_.AppendSwitch("enable-quic"); | 248 command_line_.AppendSwitch("enable-quic"); |
| 248 command_line_.AppendSwitch("enable-quic-pacing"); | 249 command_line_.AppendSwitch("enable-quic-pacing"); |
| 249 | 250 |
| 250 ConfigureQuicGlobals(); | 251 ConfigureQuicGlobals(); |
| 251 net::HttpNetworkSession::Params params; | 252 net::HttpNetworkSession::Params params; |
| 252 InitializeNetworkSessionParams(¶ms); | 253 InitializeNetworkSessionParams(¶ms); |
| 253 net::QuicTagVector options; | 254 net::QuicTagVector options; |
| 254 options.push_back(net::kPACE); | 255 options.push_back(net::kPACE); |
| 255 EXPECT_EQ(options, params.quic_connection_options); | 256 EXPECT_EQ(options, params.quic_connection_options); |
| 256 } | 257 } |
| 258 TEST_F(IOThreadTest, DisableInsecureQuicFromFieldTrialParams) { |
| 259 field_trial_group_ = "Enabled"; |
| 260 field_trial_params_["disable_insecure_quic"] = "true"; |
| 261 |
| 262 ConfigureQuicGlobals(); |
| 263 net::HttpNetworkSession::Params params; |
| 264 InitializeNetworkSessionParams(¶ms); |
| 265 EXPECT_TRUE(params.disable_insecure_quic); |
| 266 } |
| 257 | 267 |
| 258 TEST_F(IOThreadTest, EnablePacingFromFieldTrialParams) { | 268 TEST_F(IOThreadTest, EnablePacingFromFieldTrialParams) { |
| 259 field_trial_group_ = "Enabled"; | 269 field_trial_group_ = "Enabled"; |
| 260 field_trial_params_["enable_pacing"] = "true"; | 270 field_trial_params_["enable_pacing"] = "true"; |
| 261 | 271 |
| 262 ConfigureQuicGlobals(); | 272 ConfigureQuicGlobals(); |
| 263 net::HttpNetworkSession::Params params; | 273 net::HttpNetworkSession::Params params; |
| 264 InitializeNetworkSessionParams(¶ms); | 274 InitializeNetworkSessionParams(¶ms); |
| 265 net::QuicTagVector options; | 275 net::QuicTagVector options; |
| 266 options.push_back(net::kPACE); | 276 options.push_back(net::kPACE); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 command_line_.AppendSwitch(switches::kEnableQuic); | 485 command_line_.AppendSwitch(switches::kEnableQuic); |
| 476 is_quic_allowed_by_policy_ = false; | 486 is_quic_allowed_by_policy_ = false; |
| 477 ConfigureQuicGlobals(); | 487 ConfigureQuicGlobals(); |
| 478 | 488 |
| 479 net::HttpNetworkSession::Params params; | 489 net::HttpNetworkSession::Params params; |
| 480 InitializeNetworkSessionParams(¶ms); | 490 InitializeNetworkSessionParams(¶ms); |
| 481 EXPECT_FALSE(params.enable_quic); | 491 EXPECT_FALSE(params.enable_quic); |
| 482 } | 492 } |
| 483 | 493 |
| 484 } // namespace test | 494 } // namespace test |
| OLD | NEW |