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 1354283002: Use QUIC for DRP if field trial group starts with Enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor changes 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
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc » ('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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 EXPECT_FALSE(params.quic_enable_non_blocking_io); 169 EXPECT_FALSE(params.quic_enable_non_blocking_io);
170 EXPECT_FALSE(params.quic_disable_disk_cache); 170 EXPECT_FALSE(params.quic_disable_disk_cache);
171 EXPECT_FALSE(params.quic_prefer_aes); 171 EXPECT_FALSE(params.quic_prefer_aes);
172 EXPECT_FALSE(params.use_alternative_services); 172 EXPECT_FALSE(params.use_alternative_services);
173 EXPECT_EQ(4, params.quic_max_number_of_lossy_connections); 173 EXPECT_EQ(4, params.quic_max_number_of_lossy_connections);
174 EXPECT_EQ(0.5f, params.quic_packet_loss_threshold); 174 EXPECT_EQ(0.5f, params.quic_packet_loss_threshold);
175 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy()); 175 EXPECT_FALSE(IOThread::ShouldEnableQuicForDataReductionProxy());
176 } 176 }
177 177
178 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) { 178 TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) {
179 base::FieldTrialList field_trial_list(new base::MockEntropyProvider()); 179 const struct {
180 base::FieldTrialList::CreateFieldTrial( 180 std::string field_trial_group_name;
181 data_reduction_proxy::params::GetQuicFieldTrialName(), "Enabled"); 181 bool expect_enable_quic;
182 } tests[] = {
183 {
184 std::string(), false,
185 },
186 {
187 "Enabled", true,
188 },
189 {
190 "EnabledControl", true,
191 },
192 {
193 "NotEnabled", false,
194 },
195 {
196 "Control", false,
197 },
198 {
199 "Disabled", false,
200 },
201 };
182 202
183 ConfigureQuicGlobals(); 203 for (size_t i = 0; i < arraysize(tests); ++i) {
184 net::HttpNetworkSession::Params params; 204 base::FieldTrialList field_trial_list(new base::MockEntropyProvider());
185 InitializeNetworkSessionParams(&params); 205 base::FieldTrialList::CreateFieldTrial(
186 EXPECT_FALSE(params.enable_quic); 206 data_reduction_proxy::params::GetQuicFieldTrialName(),
187 EXPECT_TRUE(params.enable_quic_for_proxies); 207 tests[i].field_trial_group_name);
188 EXPECT_TRUE(IOThread::ShouldEnableQuicForDataReductionProxy()); 208
189 EXPECT_EQ(1024 * 1024, params.quic_socket_receive_buffer_size); 209 ConfigureQuicGlobals();
210 net::HttpNetworkSession::Params params;
211 InitializeNetworkSessionParams(&params);
212 EXPECT_EQ(1024 * 1024, params.quic_socket_receive_buffer_size) << i;
Ryan Hamilton 2015/09/21 17:50:47 It doesn't seem like you need to test this here, d
tbansal1 2015/09/21 17:53:15 Removed.
213 EXPECT_FALSE(params.enable_quic) << i;
214 EXPECT_EQ(tests[i].expect_enable_quic, params.enable_quic_for_proxies) << i;
215 EXPECT_EQ(tests[i].expect_enable_quic,
216 IOThread::ShouldEnableQuicForDataReductionProxy())
217 << i;
218 }
190 } 219 }
191 220
192 TEST_F(IOThreadTest, EnableQuicFromCommandLine) { 221 TEST_F(IOThreadTest, EnableQuicFromCommandLine) {
193 command_line_.AppendSwitch("enable-quic"); 222 command_line_.AppendSwitch("enable-quic");
194 223
195 ConfigureQuicGlobals(); 224 ConfigureQuicGlobals();
196 net::HttpNetworkSession::Params params; 225 net::HttpNetworkSession::Params params;
197 InitializeNetworkSessionParams(&params); 226 InitializeNetworkSessionParams(&params);
198 EXPECT_TRUE(params.enable_quic); 227 EXPECT_TRUE(params.enable_quic);
199 EXPECT_TRUE(params.enable_quic_for_proxies); 228 EXPECT_TRUE(params.enable_quic_for_proxies);
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 command_line_.AppendSwitch(switches::kEnableQuic); 495 command_line_.AppendSwitch(switches::kEnableQuic);
467 is_quic_allowed_by_policy_ = false; 496 is_quic_allowed_by_policy_ = false;
468 ConfigureQuicGlobals(); 497 ConfigureQuicGlobals();
469 498
470 net::HttpNetworkSession::Params params; 499 net::HttpNetworkSession::Params params;
471 InitializeNetworkSessionParams(&params); 500 InitializeNetworkSessionParams(&params);
472 EXPECT_FALSE(params.enable_quic); 501 EXPECT_FALSE(params.enable_quic);
473 } 502 }
474 503
475 } // namespace test 504 } // namespace test
OLDNEW
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698