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

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

Issue 780223005: Remove obsolete logic for inferring QUIC behavior from the name of field trial groups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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') | no next file » | 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 command_line_.AppendSwitch("enable-quic-pacing"); 149 command_line_.AppendSwitch("enable-quic-pacing");
150 150
151 ConfigureQuicGlobals(); 151 ConfigureQuicGlobals();
152 net::HttpNetworkSession::Params params; 152 net::HttpNetworkSession::Params params;
153 InitializeNetworkSessionParams(&params); 153 InitializeNetworkSessionParams(&params);
154 net::QuicTagVector options; 154 net::QuicTagVector options;
155 options.push_back(net::kPACE); 155 options.push_back(net::kPACE);
156 EXPECT_EQ(options, params.quic_connection_options); 156 EXPECT_EQ(options, params.quic_connection_options);
157 } 157 }
158 158
159 TEST_F(IOThreadTest, EnablePacingFromFieldTrialGroup) {
160 field_trial_group_ = "EnabledWithPacing";
161
162 ConfigureQuicGlobals();
163 net::HttpNetworkSession::Params params;
164 InitializeNetworkSessionParams(&params);
165 net::QuicTagVector options;
166 options.push_back(net::kPACE);
167 EXPECT_EQ(options, params.quic_connection_options);
168 }
169
170 TEST_F(IOThreadTest, EnablePacingFromFieldTrialParams) { 159 TEST_F(IOThreadTest, EnablePacingFromFieldTrialParams) {
171 field_trial_group_ = "Enabled"; 160 field_trial_group_ = "Enabled";
172 field_trial_params_["enable_pacing"] = "true"; 161 field_trial_params_["enable_pacing"] = "true";
173 162
174 ConfigureQuicGlobals(); 163 ConfigureQuicGlobals();
175 net::HttpNetworkSession::Params params; 164 net::HttpNetworkSession::Params params;
176 InitializeNetworkSessionParams(&params); 165 InitializeNetworkSessionParams(&params);
177 net::QuicTagVector options; 166 net::QuicTagVector options;
178 options.push_back(net::kPACE); 167 options.push_back(net::kPACE);
179 EXPECT_EQ(options, params.quic_connection_options); 168 EXPECT_EQ(options, params.quic_connection_options);
180 } 169 }
181 170
182 TEST_F(IOThreadTest, PacketLengthFromCommandLine) { 171 TEST_F(IOThreadTest, PacketLengthFromCommandLine) {
183 command_line_.AppendSwitch("enable-quic"); 172 command_line_.AppendSwitch("enable-quic");
184 command_line_.AppendSwitchASCII("quic-max-packet-length", "1350"); 173 command_line_.AppendSwitchASCII("quic-max-packet-length", "1450");
185 174
186 ConfigureQuicGlobals(); 175 ConfigureQuicGlobals();
187 net::HttpNetworkSession::Params params; 176 net::HttpNetworkSession::Params params;
188 InitializeNetworkSessionParams(&params); 177 InitializeNetworkSessionParams(&params);
189 EXPECT_EQ(1350u, params.quic_max_packet_length); 178 EXPECT_EQ(1450u, params.quic_max_packet_length);
190 } 179 }
191 180
192 TEST_F(IOThreadTest, PacketLengthFromFieldTrialGroup) { 181 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) {
193 field_trial_group_ = "Enabled1350BytePackets"; 182 field_trial_group_ = "Enabled";
183 field_trial_params_["max_packet_length"] = "1450";
194 184
195 ConfigureQuicGlobals(); 185 ConfigureQuicGlobals();
196 net::HttpNetworkSession::Params params; 186 net::HttpNetworkSession::Params params;
197 InitializeNetworkSessionParams(&params); 187 InitializeNetworkSessionParams(&params);
198 EXPECT_EQ(1350u, params.quic_max_packet_length); 188 EXPECT_EQ(1450u, params.quic_max_packet_length);
199 }
200
201 TEST_F(IOThreadTest, PacketLengthFromFieldTrialParams) {
202 field_trial_group_ = "Enabled";
203 field_trial_params_["max_packet_length"] = "1350";
204
205 ConfigureQuicGlobals();
206 net::HttpNetworkSession::Params params;
207 InitializeNetworkSessionParams(&params);
208 EXPECT_EQ(1350u, params.quic_max_packet_length);
209 } 189 }
210 190
211 TEST_F(IOThreadTest, QuicVersionFromCommandLine) { 191 TEST_F(IOThreadTest, QuicVersionFromCommandLine) {
212 command_line_.AppendSwitch("enable-quic"); 192 command_line_.AppendSwitch("enable-quic");
213 std::string version = 193 std::string version =
214 net::QuicVersionToString(net::QuicSupportedVersions().back()); 194 net::QuicVersionToString(net::QuicSupportedVersions().back());
215 command_line_.AppendSwitchASCII("quic-version", version); 195 command_line_.AppendSwitchASCII("quic-version", version);
216 196
217 ConfigureQuicGlobals(); 197 ConfigureQuicGlobals();
218 net::HttpNetworkSession::Params params; 198 net::HttpNetworkSession::Params params;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 field_trial_group_ = "Enabled"; 321 field_trial_group_ = "Enabled";
342 field_trial_params_["alternate_protocol_probability_threshold"] = ".5"; 322 field_trial_params_["alternate_protocol_probability_threshold"] = ".5";
343 323
344 ConfigureQuicGlobals(); 324 ConfigureQuicGlobals();
345 net::HttpNetworkSession::Params params; 325 net::HttpNetworkSession::Params params;
346 InitializeNetworkSessionParams(&params); 326 InitializeNetworkSessionParams(&params);
347 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold); 327 EXPECT_EQ(.5, params.alternate_protocol_probability_threshold);
348 } 328 }
349 329
350 } // namespace test 330 } // namespace test
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698