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 command_line_.AppendSwitch("enable-quic"); | 193 command_line_.AppendSwitch("enable-quic"); |
194 | 194 |
195 ConfigureQuicGlobals(); | 195 ConfigureQuicGlobals(); |
196 net::HttpNetworkSession::Params params; | 196 net::HttpNetworkSession::Params params; |
197 InitializeNetworkSessionParams(¶ms); | 197 InitializeNetworkSessionParams(¶ms); |
198 EXPECT_TRUE(params.enable_quic); | 198 EXPECT_TRUE(params.enable_quic); |
199 EXPECT_TRUE(params.enable_quic_for_proxies); | 199 EXPECT_TRUE(params.enable_quic_for_proxies); |
200 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); | 200 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); |
201 } | 201 } |
202 | 202 |
203 TEST_F(IOThreadTest, EnableAlternativeServicesFromCommandLineWithQuicDisabled) { | |
204 command_line_.AppendSwitch("enable-alternative-services"); | |
205 | |
206 ConfigureQuicGlobals(); | |
207 net::HttpNetworkSession::Params params; | |
208 InitializeNetworkSessionParams(¶ms); | |
209 EXPECT_FALSE(params.enable_quic); | |
210 EXPECT_TRUE(params.use_alternative_services); | |
Ryan Hamilton
2015/09/08 17:50:06
Oh, interesting. Is this behavior we're expecting
Bence
2015/09/14 21:56:16
I really do not know. There is nothing QUIC-speci
| |
211 } | |
212 | |
213 TEST_F(IOThreadTest, EnableAlternativeServicesFromCommandLineWithQuicEnabled) { | |
214 command_line_.AppendSwitch("enable-quic"); | |
215 command_line_.AppendSwitch("enable-alternative-services"); | |
216 | |
217 ConfigureQuicGlobals(); | |
218 net::HttpNetworkSession::Params params; | |
219 InitializeNetworkSessionParams(¶ms); | |
220 EXPECT_TRUE(params.enable_quic); | |
221 EXPECT_TRUE(params.use_alternative_services); | |
222 } | |
223 | |
203 TEST_F(IOThreadTest, EnableInsecureQuicFromFieldTrialParams) { | 224 TEST_F(IOThreadTest, EnableInsecureQuicFromFieldTrialParams) { |
204 field_trial_group_ = "Enabled"; | 225 field_trial_group_ = "Enabled"; |
205 field_trial_params_["enable_insecure_quic"] = "true"; | 226 field_trial_params_["enable_insecure_quic"] = "true"; |
206 | 227 |
207 ConfigureQuicGlobals(); | 228 ConfigureQuicGlobals(); |
208 net::HttpNetworkSession::Params params; | 229 net::HttpNetworkSession::Params params; |
209 InitializeNetworkSessionParams(¶ms); | 230 InitializeNetworkSessionParams(¶ms); |
210 EXPECT_TRUE(params.enable_insecure_quic); | 231 EXPECT_TRUE(params.enable_insecure_quic); |
211 } | 232 } |
212 | 233 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
445 command_line_.AppendSwitch(switches::kEnableQuic); | 466 command_line_.AppendSwitch(switches::kEnableQuic); |
446 is_quic_allowed_by_policy_ = false; | 467 is_quic_allowed_by_policy_ = false; |
447 ConfigureQuicGlobals(); | 468 ConfigureQuicGlobals(); |
448 | 469 |
449 net::HttpNetworkSession::Params params; | 470 net::HttpNetworkSession::Params params; |
450 InitializeNetworkSessionParams(¶ms); | 471 InitializeNetworkSessionParams(¶ms); |
451 EXPECT_FALSE(params.enable_quic); | 472 EXPECT_FALSE(params.enable_quic); |
452 } | 473 } |
453 | 474 |
454 } // namespace test | 475 } // namespace test |
OLD | NEW |