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

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

Issue 1137073003: Add a new disable_insecure_quic finch parameter to disable insecure QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 5 years, 7 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') | net/http/http_network_session.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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 193 }
194 194
195 TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) { 195 TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) {
196 field_trial_group_ = "Enabled"; 196 field_trial_group_ = "Enabled";
197 197
198 ConfigureQuicGlobals(); 198 ConfigureQuicGlobals();
199 net::HttpNetworkSession::Params default_params; 199 net::HttpNetworkSession::Params default_params;
200 net::HttpNetworkSession::Params params; 200 net::HttpNetworkSession::Params params;
201 InitializeNetworkSessionParams(&params); 201 InitializeNetworkSessionParams(&params);
202 EXPECT_TRUE(params.enable_quic); 202 EXPECT_TRUE(params.enable_quic);
203 EXPECT_FALSE(params.disable_insecure_quic);
203 EXPECT_TRUE(params.enable_quic_for_proxies); 204 EXPECT_TRUE(params.enable_quic_for_proxies);
204 EXPECT_EQ(1350u, params.quic_max_packet_length); 205 EXPECT_EQ(1350u, params.quic_max_packet_length);
205 EXPECT_EQ(1.0, params.alternative_service_probability_threshold); 206 EXPECT_EQ(1.0, params.alternative_service_probability_threshold);
206 EXPECT_EQ(default_params.quic_supported_versions, 207 EXPECT_EQ(default_params.quic_supported_versions,
207 params.quic_supported_versions); 208 params.quic_supported_versions);
208 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); 209 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options);
209 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); 210 EXPECT_FALSE(params.quic_always_require_handshake_confirmation);
210 EXPECT_FALSE(params.quic_disable_connection_pooling); 211 EXPECT_FALSE(params.quic_disable_connection_pooling);
211 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier); 212 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier);
212 EXPECT_FALSE(params.quic_enable_connection_racing); 213 EXPECT_FALSE(params.quic_enable_connection_racing);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 command_line_.AppendSwitch("enable-quic"); 248 command_line_.AppendSwitch("enable-quic");
248 command_line_.AppendSwitch("enable-quic-pacing"); 249 command_line_.AppendSwitch("enable-quic-pacing");
249 250
250 ConfigureQuicGlobals(); 251 ConfigureQuicGlobals();
251 net::HttpNetworkSession::Params params; 252 net::HttpNetworkSession::Params params;
252 InitializeNetworkSessionParams(&params); 253 InitializeNetworkSessionParams(&params);
253 net::QuicTagVector options; 254 net::QuicTagVector options;
254 options.push_back(net::kPACE); 255 options.push_back(net::kPACE);
255 EXPECT_EQ(options, params.quic_connection_options); 256 EXPECT_EQ(options, params.quic_connection_options);
256 } 257 }
258 TEST_F(IOThreadTest, DisableInsecureQuicFromFieldTrialParams) {
259 field_trial_group_ = "Enabled";
260 field_trial_params_["disable_insecure_quic"] = "true";
261
262 ConfigureQuicGlobals();
263 net::HttpNetworkSession::Params params;
264 InitializeNetworkSessionParams(&params);
265 EXPECT_TRUE(params.disable_insecure_quic);
266 }
257 267
258 TEST_F(IOThreadTest, EnablePacingFromFieldTrialParams) { 268 TEST_F(IOThreadTest, EnablePacingFromFieldTrialParams) {
259 field_trial_group_ = "Enabled"; 269 field_trial_group_ = "Enabled";
260 field_trial_params_["enable_pacing"] = "true"; 270 field_trial_params_["enable_pacing"] = "true";
261 271
262 ConfigureQuicGlobals(); 272 ConfigureQuicGlobals();
263 net::HttpNetworkSession::Params params; 273 net::HttpNetworkSession::Params params;
264 InitializeNetworkSessionParams(&params); 274 InitializeNetworkSessionParams(&params);
265 net::QuicTagVector options; 275 net::QuicTagVector options;
266 options.push_back(net::kPACE); 276 options.push_back(net::kPACE);
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 command_line_.AppendSwitch(switches::kEnableQuic); 485 command_line_.AppendSwitch(switches::kEnableQuic);
476 is_quic_allowed_by_policy_ = false; 486 is_quic_allowed_by_policy_ = false;
477 ConfigureQuicGlobals(); 487 ConfigureQuicGlobals();
478 488
479 net::HttpNetworkSession::Params params; 489 net::HttpNetworkSession::Params params;
480 InitializeNetworkSessionParams(&params); 490 InitializeNetworkSessionParams(&params);
481 EXPECT_FALSE(params.enable_quic); 491 EXPECT_FALSE(params.enable_quic);
482 } 492 }
483 493
484 } // namespace test 494 } // namespace test
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | net/http/http_network_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698