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

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

Issue 1165283004: Add a new prefer_aes finch options for QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 EXPECT_EQ(1.0, params.alternative_service_probability_threshold); 181 EXPECT_EQ(1.0, params.alternative_service_probability_threshold);
182 EXPECT_EQ(default_params.quic_supported_versions, 182 EXPECT_EQ(default_params.quic_supported_versions,
183 params.quic_supported_versions); 183 params.quic_supported_versions);
184 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); 184 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options);
185 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); 185 EXPECT_FALSE(params.quic_always_require_handshake_confirmation);
186 EXPECT_FALSE(params.quic_disable_connection_pooling); 186 EXPECT_FALSE(params.quic_disable_connection_pooling);
187 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier); 187 EXPECT_EQ(0.25f, params.quic_load_server_info_timeout_srtt_multiplier);
188 EXPECT_FALSE(params.quic_enable_connection_racing); 188 EXPECT_FALSE(params.quic_enable_connection_racing);
189 EXPECT_FALSE(params.quic_enable_non_blocking_io); 189 EXPECT_FALSE(params.quic_enable_non_blocking_io);
190 EXPECT_FALSE(params.quic_disable_disk_cache); 190 EXPECT_FALSE(params.quic_disable_disk_cache);
191 EXPECT_FALSE(params.quic_prefer_aes);
191 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections); 192 EXPECT_EQ(0, params.quic_max_number_of_lossy_connections);
192 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold); 193 EXPECT_EQ(1.0f, params.quic_packet_loss_threshold);
193 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); 194 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy());
194 } 195 }
195 196
196 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { 197 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) {
197 base::FieldTrialList field_trial_list(new base::MockEntropyProvider()); 198 base::FieldTrialList field_trial_list(new base::MockEntropyProvider());
198 base::FieldTrialList::CreateFieldTrial( 199 base::FieldTrialList::CreateFieldTrial(
199 data_reduction_proxy::DataReductionProxyParams::GetQuicFieldTrialName(), 200 data_reduction_proxy::DataReductionProxyParams::GetQuicFieldTrialName(),
200 "Enabled"); 201 "Enabled");
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 357
357 TEST_F(IOThreadTest, QuicDisableDiskCache) { 358 TEST_F(IOThreadTest, QuicDisableDiskCache) {
358 field_trial_group_ = "Enabled"; 359 field_trial_group_ = "Enabled";
359 field_trial_params_["disable_disk_cache"] = "true"; 360 field_trial_params_["disable_disk_cache"] = "true";
360 ConfigureQuicGlobals(); 361 ConfigureQuicGlobals();
361 net::HttpNetworkSession::Params params; 362 net::HttpNetworkSession::Params params;
362 InitializeNetworkSessionParams(&params); 363 InitializeNetworkSessionParams(&params);
363 EXPECT_TRUE(params.quic_disable_disk_cache); 364 EXPECT_TRUE(params.quic_disable_disk_cache);
364 } 365 }
365 366
367 TEST_F(IOThreadTest, QuicPreferAes) {
368 field_trial_group_ = "Enabled";
369 field_trial_params_["prefer_aes"] = "true";
370 ConfigureQuicGlobals();
371 net::HttpNetworkSession::Params params;
372 InitializeNetworkSessionParams(&params);
373 EXPECT_TRUE(params.quic_prefer_aes);
374 }
375
366 TEST_F(IOThreadTest, QuicMaxNumberOfLossyConnectionsFieldTrialParams) { 376 TEST_F(IOThreadTest, QuicMaxNumberOfLossyConnectionsFieldTrialParams) {
367 field_trial_group_ = "Enabled"; 377 field_trial_group_ = "Enabled";
368 field_trial_params_["max_number_of_lossy_connections"] = "5"; 378 field_trial_params_["max_number_of_lossy_connections"] = "5";
369 ConfigureQuicGlobals(); 379 ConfigureQuicGlobals();
370 net::HttpNetworkSession::Params params; 380 net::HttpNetworkSession::Params params;
371 InitializeNetworkSessionParams(&params); 381 InitializeNetworkSessionParams(&params);
372 EXPECT_EQ(5, params.quic_max_number_of_lossy_connections); 382 EXPECT_EQ(5, params.quic_max_number_of_lossy_connections);
373 } 383 }
374 384
375 TEST_F(IOThreadTest, QuicPacketLossThresholdFieldTrialParams) { 385 TEST_F(IOThreadTest, QuicPacketLossThresholdFieldTrialParams) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 command_line_.AppendSwitch(switches::kEnableQuic); 445 command_line_.AppendSwitch(switches::kEnableQuic);
436 is_quic_allowed_by_policy_ = false; 446 is_quic_allowed_by_policy_ = false;
437 ConfigureQuicGlobals(); 447 ConfigureQuicGlobals();
438 448
439 net::HttpNetworkSession::Params params; 449 net::HttpNetworkSession::Params params;
440 InitializeNetworkSessionParams(&params); 450 InitializeNetworkSessionParams(&params);
441 EXPECT_FALSE(params.enable_quic); 451 EXPECT_FALSE(params.enable_quic);
442 } 452 }
443 453
444 } // namespace test 454 } // 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