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

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

Issue 811073004: QUIC - don't load data from disk cache if alternate protocol map doesn't (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: renamed variable Created 6 years 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 "chrome/browser/io_thread.h" 6 #include "chrome/browser/io_thread.h"
7 #include "net/http/http_network_session.h" 7 #include "net/http/http_network_session.h"
8 #include "net/http/http_server_properties_impl.h" 8 #include "net/http/http_server_properties_impl.h"
9 #include "net/quic/quic_protocol.h" 9 #include "net/quic/quic_protocol.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 InitializeNetworkSessionParams(&params); 126 InitializeNetworkSessionParams(&params);
127 EXPECT_TRUE(params.enable_quic); 127 EXPECT_TRUE(params.enable_quic);
128 EXPECT_EQ(1350u, params.quic_max_packet_length); 128 EXPECT_EQ(1350u, params.quic_max_packet_length);
129 EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold); 129 EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold);
130 EXPECT_EQ(default_params.quic_supported_versions, 130 EXPECT_EQ(default_params.quic_supported_versions,
131 params.quic_supported_versions); 131 params.quic_supported_versions);
132 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options); 132 EXPECT_EQ(net::QuicTagVector(), params.quic_connection_options);
133 EXPECT_FALSE(params.quic_always_require_handshake_confirmation); 133 EXPECT_FALSE(params.quic_always_require_handshake_confirmation);
134 EXPECT_FALSE(params.quic_disable_connection_pooling); 134 EXPECT_FALSE(params.quic_disable_connection_pooling);
135 EXPECT_EQ(0, params.quic_load_server_info_timeout_ms); 135 EXPECT_EQ(0, params.quic_load_server_info_timeout_ms);
136 EXPECT_FALSE(params.quic_disable_loading_server_info_for_new_servers);
136 } 137 }
137 138
138 TEST_F(IOThreadTest, EnableQuicFromCommandLine) { 139 TEST_F(IOThreadTest, EnableQuicFromCommandLine) {
139 command_line_.AppendSwitch("enable-quic"); 140 command_line_.AppendSwitch("enable-quic");
140 141
141 ConfigureQuicGlobals(); 142 ConfigureQuicGlobals();
142 net::HttpNetworkSession::Params params; 143 net::HttpNetworkSession::Params params;
143 InitializeNetworkSessionParams(&params); 144 InitializeNetworkSessionParams(&params);
144 EXPECT_TRUE(params.enable_quic); 145 EXPECT_TRUE(params.enable_quic);
145 } 146 }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 289
289 TEST_F(IOThreadTest, QuicLoadServerInfoTimeoutFromFieldTrialParams) { 290 TEST_F(IOThreadTest, QuicLoadServerInfoTimeoutFromFieldTrialParams) {
290 field_trial_group_ = "Enabled"; 291 field_trial_group_ = "Enabled";
291 field_trial_params_["load_server_info_timeout"] = "50"; 292 field_trial_params_["load_server_info_timeout"] = "50";
292 ConfigureQuicGlobals(); 293 ConfigureQuicGlobals();
293 net::HttpNetworkSession::Params params; 294 net::HttpNetworkSession::Params params;
294 InitializeNetworkSessionParams(&params); 295 InitializeNetworkSessionParams(&params);
295 EXPECT_EQ(50, params.quic_load_server_info_timeout_ms); 296 EXPECT_EQ(50, params.quic_load_server_info_timeout_ms);
296 } 297 }
297 298
299 TEST_F(IOThreadTest, QuicDisableLoadingServerInfoForNewServers) {
300 field_trial_group_ = "Enabled";
301 field_trial_params_["disable_loading_server_info_for_new_servers"] = "true";
302 ConfigureQuicGlobals();
303 net::HttpNetworkSession::Params params;
304 InitializeNetworkSessionParams(&params);
305 EXPECT_TRUE(params.quic_disable_loading_server_info_for_new_servers);
Ryan Hamilton 2014/12/18 21:12:55 please add an EXPECT_FALSE for this field up to th
ramant (doing other things) 2014/12/18 23:05:55 Done.
306 }
307
298 TEST_F(IOThreadTest, 308 TEST_F(IOThreadTest,
299 AlternateProtocolProbabilityThresholdFromFlag) { 309 AlternateProtocolProbabilityThresholdFromFlag) {
300 command_line_.AppendSwitchASCII("alternate-protocol-probability-threshold", 310 command_line_.AppendSwitchASCII("alternate-protocol-probability-threshold",
301 ".5"); 311 ".5");
302 312
303 ConfigureQuicGlobals(); 313 ConfigureQuicGlobals();
304 net::HttpNetworkSession::Params params; 314 net::HttpNetworkSession::Params params;
305 InitializeNetworkSessionParams(&params); 315 InitializeNetworkSessionParams(&params);
306 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); 316 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold);
307 } 317 }
(...skipping 13 matching lines...) Expand all
321 field_trial_group_ = "Enabled"; 331 field_trial_group_ = "Enabled";
322 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; 332 field_trial_params_["alternate_protocol_probability_threshold"] = ".5";
323 333
324 ConfigureQuicGlobals(); 334 ConfigureQuicGlobals();
325 net::HttpNetworkSession::Params params; 335 net::HttpNetworkSession::Params params;
326 InitializeNetworkSessionParams(&params); 336 InitializeNetworkSessionParams(&params);
327 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); 337 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold);
328 } 338 }
329 339
330 } // namespace test 340 } // 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