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