| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold); | 132 EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold); |
| 133 EXPECT_EQ(default_params.quic_supported_versions, | 133 EXPECT_EQ(default_params.quic_supported_versions, |
| 134 params.quic_supported_versions); | 134 params.quic_supported_versions); |
| 135 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); | 135 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); |
| 136 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); | 136 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); |
| 137 EXPECT_FALSE(params.quic_disable_connection_pooling); | 137 EXPECT_FALSE(params.quic_disable_connection_pooling); |
| 138 EXPECT_EQ(0, params.quic_load_server_info_timeout_ms); | 138 EXPECT_EQ(0, params.quic_load_server_info_timeout_ms); |
| 139 EXPECT_EQ(0.0f, params.quic_load_server_info_timeout_srtt_multiplier); | 139 EXPECT_EQ(0.0f, params.quic_load_server_info_timeout_srtt_multiplier); |
| 140 EXPECT_FALSE(params.quic_enable_truncated_connection_ids); | 140 EXPECT_FALSE(params.quic_enable_truncated_connection_ids); |
| 141 EXPECT_FALSE(params.quic_enable_connection_racing); | 141 EXPECT_FALSE(params.quic_enable_connection_racing); |
| 142 EXPECT_FALSE(params.quic_enable_non_blocking_io); |
| 142 EXPECT_FALSE(params.quic_disable_disk_cache); | 143 EXPECT_FALSE(params.quic_disable_disk_cache); |
| 143 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); | 144 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); |
| 144 } | 145 } |
| 145 | 146 |
| 146 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { | 147 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { |
| 147 base::FieldTrialList field_trial_list(new BadEntropyProvider()); | 148 base::FieldTrialList field_trial_list(new BadEntropyProvider()); |
| 148 base::FieldTrialList::CreateFieldTrial( | 149 base::FieldTrialList::CreateFieldTrial( |
| 149 data_reduction_proxy::DataReductionProxyParams::GetQuicFieldTrialName(), | 150 data_reduction_proxy::DataReductionProxyParams::GetQuicFieldTrialName(), |
| 150 "Enabled"); | 151 "Enabled"); |
| 151 | 152 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 323 |
| 323 TEST_F(IOThreadTest, QuicEnableConnectionRacing) { | 324 TEST_F(IOThreadTest, QuicEnableConnectionRacing) { |
| 324 field_trial_group_ = "Enabled"; | 325 field_trial_group_ = "Enabled"; |
| 325 field_trial_params_["enable_connection_racing"] = "true"; | 326 field_trial_params_["enable_connection_racing"] = "true"; |
| 326 ConfigureQuicGlobals(); | 327 ConfigureQuicGlobals(); |
| 327 net::HttpNetworkSession::Params params; | 328 net::HttpNetworkSession::Params params; |
| 328 InitializeNetworkSessionParams(¶ms); | 329 InitializeNetworkSessionParams(¶ms); |
| 329 EXPECT_TRUE(params.quic_enable_connection_racing); | 330 EXPECT_TRUE(params.quic_enable_connection_racing); |
| 330 } | 331 } |
| 331 | 332 |
| 333 TEST_F(IOThreadTest, QuicEnableNonBlockingIO) { |
| 334 field_trial_group_ = "Enabled"; |
| 335 field_trial_params_["enable_non_blocking_io"] = "true"; |
| 336 ConfigureQuicGlobals(); |
| 337 net::HttpNetworkSession::Params params; |
| 338 InitializeNetworkSessionParams(¶ms); |
| 339 EXPECT_TRUE(params.quic_enable_non_blocking_io); |
| 340 } |
| 341 |
| 332 TEST_F(IOThreadTest, QuicDisableDiskCache) { | 342 TEST_F(IOThreadTest, QuicDisableDiskCache) { |
| 333 field_trial_group_ = "Enabled"; | 343 field_trial_group_ = "Enabled"; |
| 334 field_trial_params_["disable_disk_cache"] = "true"; | 344 field_trial_params_["disable_disk_cache"] = "true"; |
| 335 ConfigureQuicGlobals(); | 345 ConfigureQuicGlobals(); |
| 336 net::HttpNetworkSession::Params params; | 346 net::HttpNetworkSession::Params params; |
| 337 InitializeNetworkSessionParams(¶ms); | 347 InitializeNetworkSessionParams(¶ms); |
| 338 EXPECT_TRUE(params.quic_disable_disk_cache); | 348 EXPECT_TRUE(params.quic_disable_disk_cache); |
| 339 } | 349 } |
| 340 | 350 |
| 341 TEST_F(IOThreadTest, QuicReceiveBufferSize) { | 351 TEST_F(IOThreadTest, QuicReceiveBufferSize) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 field_trial_group_ = "Enabled"; | 383 field_trial_group_ = "Enabled"; |
| 374 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; | 384 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; |
| 375 | 385 |
| 376 ConfigureQuicGlobals(); | 386 ConfigureQuicGlobals(); |
| 377 net::HttpNetworkSession::Params params; | 387 net::HttpNetworkSession::Params params; |
| 378 InitializeNetworkSessionParams(¶ms); | 388 InitializeNetworkSessionParams(¶ms); |
| 379 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); | 389 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); |
| 380 } | 390 } |
| 381 | 391 |
| 382 } // namespace test | 392 } // namespace test |
| OLD | NEW |