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 "chrome/browser/io_thread.h" | 7 #include "chrome/browser/io_thread.h" |
8 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" | 8 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" |
9 #include "net/http/http_network_session.h" | 9 #include "net/http/http_network_session.h" |
10 #include "net/http/http_server_properties_impl.h" | 10 #include "net/http/http_server_properties_impl.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold); | 218 EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold); |
219 EXPECT_EQ(default_params.quic_supported_versions, | 219 EXPECT_EQ(default_params.quic_supported_versions, |
220 params.quic_supported_versions); | 220 params.quic_supported_versions); |
221 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); | 221 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); |
222 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); | 222 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); |
223 EXPECT_FALSE(params.quic_disable_connection_pooling); | 223 EXPECT_FALSE(params.quic_disable_connection_pooling); |
224 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier); | 224 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier); |
225 EXPECT_FALSE(params.quic_enable_connection_racing); | 225 EXPECT_FALSE(params.quic_enable_connection_racing); |
226 EXPECT_FALSE(params.quic_enable_non_blocking_io); | 226 EXPECT_FALSE(params.quic_enable_non_blocking_io); |
227 EXPECT_FALSE(params.quic_disable_disk_cache); | 227 EXPECT_FALSE(params.quic_disable_disk_cache); |
| 228 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections); |
| 229 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold); |
228 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); | 230 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); |
229 } | 231 } |
230 | 232 |
231 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { | 233 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { |
232 base::FieldTrialList field_trial_list(new BadEntropyProvider()); | 234 base::FieldTrialList field_trial_list(new BadEntropyProvider()); |
233 base::FieldTrialList::CreateFieldTrial( | 235 base::FieldTrialList::CreateFieldTrial( |
234 data_reduction_proxy::DataReductionProxyParams::GetQuicFieldTrialName(), | 236 data_reduction_proxy::DataReductionProxyParams::GetQuicFieldTrialName(), |
235 "Enabled"); | 237 "Enabled"); |
236 | 238 |
237 ConfigureQuicGlobals(); | 239 ConfigureQuicGlobals(); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 409 |
408 TEST_F(IOThreadTest, QuicDisableDiskCache) { | 410 TEST_F(IOThreadTest, QuicDisableDiskCache) { |
409 field_trial_group_ = "Enabled"; | 411 field_trial_group_ = "Enabled"; |
410 field_trial_params_["disable_disk_cache"] = "true"; | 412 field_trial_params_["disable_disk_cache"] = "true"; |
411 ConfigureQuicGlobals(); | 413 ConfigureQuicGlobals(); |
412 net::HttpNetworkSession::Params params; | 414 net::HttpNetworkSession::Params params; |
413 InitializeNetworkSessionParams(¶ms); | 415 InitializeNetworkSessionParams(¶ms); |
414 EXPECT_TRUE(params.quic_disable_disk_cache); | 416 EXPECT_TRUE(params.quic_disable_disk_cache); |
415 } | 417 } |
416 | 418 |
| 419 TEST_F(IOThreadTest, QuicMaxNumberOfLossyConnectionsFieldTrialParams) { |
| 420 field_trial_group_ = "Enabled"; |
| 421 field_trial_params_["max_number_of_lossy_connections"] = "5"; |
| 422 ConfigureQuicGlobals(); |
| 423 net::HttpNetworkSession::Params params; |
| 424 InitializeNetworkSessionParams(¶ms); |
| 425 EXPECT_EQ(5, params.quic_max_number_of_lossy_connections); |
| 426 } |
| 427 |
| 428 TEST_F(IOThreadTest, QuicPacketLossThresholdFieldTrialParams) { |
| 429 field_trial_group_ = "Enabled"; |
| 430 field_trial_params_["packet_loss_threshold"] = "0.5"; |
| 431 ConfigureQuicGlobals(); |
| 432 net::HttpNetworkSession::Params params; |
| 433 InitializeNetworkSessionParams(¶ms); |
| 434 EXPECT_EQ(0.5f, params.quic_packet_loss_threshold); |
| 435 } |
| 436 |
417 TEST_F(IOThreadTest, QuicReceiveBufferSize) { | 437 TEST_F(IOThreadTest, QuicReceiveBufferSize) { |
418 field_trial_group_ = "Enabled"; | 438 field_trial_group_ = "Enabled"; |
419 field_trial_params_["receive_buffer_size"] = "1048576"; | 439 field_trial_params_["receive_buffer_size"] = "1048576"; |
420 ConfigureQuicGlobals(); | 440 ConfigureQuicGlobals(); |
421 net::HttpNetworkSession::Params params; | 441 net::HttpNetworkSession::Params params; |
422 InitializeNetworkSessionParams(¶ms); | 442 InitializeNetworkSessionParams(¶ms); |
423 EXPECT_EQ(1048576, params.quic_socket_receive_buffer_size); | 443 EXPECT_EQ(1048576, params.quic_socket_receive_buffer_size); |
424 } | 444 } |
425 | 445 |
426 TEST_F(IOThreadTest, | 446 TEST_F(IOThreadTest, |
(...skipping 22 matching lines...) Expand all Loading... |
449 field_trial_group_ = "Enabled"; | 469 field_trial_group_ = "Enabled"; |
450 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; | 470 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; |
451 | 471 |
452 ConfigureQuicGlobals(); | 472 ConfigureQuicGlobals(); |
453 net::HttpNetworkSession::Params params; | 473 net::HttpNetworkSession::Params params; |
454 InitializeNetworkSessionParams(¶ms); | 474 InitializeNetworkSessionParams(¶ms); |
455 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); | 475 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); |
456 } | 476 } |
457 | 477 |
458 } // namespace test | 478 } // namespace test |
OLD | NEW |