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

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

Issue 1393713003: Remove insecure QUIC support from Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 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
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 148
149 TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) { 149 TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) {
150 field_trial_group_ = "Enabled"; 150 field_trial_group_ = "Enabled";
151 151
152 ConfigureQuicGlobals(); 152 ConfigureQuicGlobals();
153 net::HttpNetworkSession::Params default_params; 153 net::HttpNetworkSession::Params default_params;
154 net::HttpNetworkSession::Params params; 154 net::HttpNetworkSession::Params params;
155 InitializeNetworkSessionParams(&params); 155 InitializeNetworkSessionParams(&params);
156 EXPECT_TRUE(params.enable_quic); 156 EXPECT_TRUE(params.enable_quic);
157 EXPECT_FALSE(params.enable_insecure_quic);
158 EXPECT_TRUE(params.enable_quic_for_proxies); 157 EXPECT_TRUE(params.enable_quic_for_proxies);
159 EXPECT_EQ(1350u, params.quic_max_packet_length); 158 EXPECT_EQ(1350u, params.quic_max_packet_length);
160 EXPECT_EQ(1.0, params.alternative_service_probability_threshold); 159 EXPECT_EQ(1.0, params.alternative_service_probability_threshold);
161 EXPECT_EQ(default_params.quic_supported_versions, 160 EXPECT_EQ(default_params.quic_supported_versions,
162 params.quic_supported_versions); 161 params.quic_supported_versions);
163 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); 162 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options);
164 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); 163 EXPECT_FALSE(params.quic_always_require_handshake_confirmation);
165 EXPECT_FALSE(params.quic_disable_connection_pooling); 164 EXPECT_FALSE(params.quic_disable_connection_pooling);
166 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier); 165 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier);
167 EXPECT_FALSE(params.quic_enable_connection_racing); 166 EXPECT_FALSE(params.quic_enable_connection_racing);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 command_line_.AppendSwitch("enable-quic"); 241 command_line_.AppendSwitch("enable-quic");
243 command_line_.AppendSwitch("enable-alternative-services"); 242 command_line_.AppendSwitch("enable-alternative-services");
244 243
245 ConfigureQuicGlobals(); 244 ConfigureQuicGlobals();
246 net::HttpNetworkSession::Params params; 245 net::HttpNetworkSession::Params params;
247 InitializeNetworkSessionParams(&params); 246 InitializeNetworkSessionParams(&params);
248 EXPECT_TRUE(params.enable_quic); 247 EXPECT_TRUE(params.enable_quic);
249 EXPECT_TRUE(params.use_alternative_services); 248 EXPECT_TRUE(params.use_alternative_services);
250 } 249 }
251 250
252 TEST_F(IOThreadTest, EnableInsecureQuicFromFieldTrialParams) {
253 field_trial_group_ = "Enabled";
254 field_trial_params_["enable_insecure_quic"] = "true";
255
256 ConfigureQuicGlobals();
257 net::HttpNetworkSession::Params params;
258 InitializeNetworkSessionParams(&params);
259 EXPECT_TRUE(params.enable_insecure_quic);
260 }
261
262 TEST_F(IOThreadTest, EnableInsecureQuicCommandLine) {
263 command_line_.AppendSwitch("enable-quic");
264 command_line_.AppendSwitch("enable-insecure-quic");
265
266 ConfigureQuicGlobals();
267 net::HttpNetworkSession::Params params;
268 InitializeNetworkSessionParams(&params);
269 EXPECT_TRUE(params.enable_insecure_quic);
270 }
271
272 TEST_F(IOThreadTest, PacketLengthFromCommandLine) { 251 TEST_F(IOThreadTest, PacketLengthFromCommandLine) {
273 command_line_.AppendSwitch("enable-quic"); 252 command_line_.AppendSwitch("enable-quic");
274 command_line_.AppendSwitchASCII("quic-max-packet-length", "1450"); 253 command_line_.AppendSwitchASCII("quic-max-packet-length", "1450");
275 254
276 ConfigureQuicGlobals(); 255 ConfigureQuicGlobals();
277 net::HttpNetworkSession::Params params; 256 net::HttpNetworkSession::Params params;
278 InitializeNetworkSessionParams(&params); 257 InitializeNetworkSessionParams(&params);
279 EXPECT_EQ(1450u, params.quic_max_packet_length); 258 EXPECT_EQ(1450u, params.quic_max_packet_length);
280 } 259 }
281 260
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 command_line_.AppendSwitch(switches::kEnableQuic); 482 command_line_.AppendSwitch(switches::kEnableQuic);
504 is_quic_allowed_by_policy_ = false; 483 is_quic_allowed_by_policy_ = false;
505 ConfigureQuicGlobals(); 484 ConfigureQuicGlobals();
506 485
507 net::HttpNetworkSession::Params params; 486 net::HttpNetworkSession::Params params;
508 InitializeNetworkSessionParams(&params); 487 InitializeNetworkSessionParams(&params);
509 EXPECT_FALSE(params.enable_quic); 488 EXPECT_FALSE(params.enable_quic);
510 } 489 }
511 490
512 } // namespace test 491 } // namespace test
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698