Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: chrome/browser/io_thread_unittest.cc

Issue 1309363003: Add flag to enable alternative services. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix AboutFlagsHistogramTest.CheckHistograms. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(&params); 197 InitializeNetworkSessionParams(&params);
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(&params);
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(&params);
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(&params); 230 InitializeNetworkSessionParams(&params);
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
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(&params); 471 InitializeNetworkSessionParams(&params);
451 EXPECT_FALSE(params.enable_quic); 472 EXPECT_FALSE(params.enable_quic);
452 } 473 }
453 474
454 } // namespace test 475 } // namespace test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698