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

Side by Side Diff: net/quic/core/quic_protocol_test.cc

Issue 2242423002: Disable QUIC versions less than v32, protected by --FLAGS_quic_disable_pre_32. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@130124951
Patch Set: Created 4 years, 4 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 | « net/quic/core/quic_protocol.cc ('k') | net/tools/quic/end_to_end_test.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/quic/core/quic_protocol.h" 5 #include "net/quic/core/quic_protocol.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/quic/core/quic_flags.h" 10 #include "net/quic/core/quic_flags.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 std::ostringstream stream; 281 std::ostringstream stream;
282 stream << frame; 282 stream << frame;
283 EXPECT_EQ("{ path_id: 1 }\n", stream.str()); 283 EXPECT_EQ("{ path_id: 1 }\n", stream.str());
284 } 284 }
285 285
286 TEST(QuicProtocolTest, FilterSupportedVersions) { 286 TEST(QuicProtocolTest, FilterSupportedVersions) {
287 QuicVersionVector all_versions = { 287 QuicVersionVector all_versions = {
288 QUIC_VERSION_30, QUIC_VERSION_31, QUIC_VERSION_32, QUIC_VERSION_33, 288 QUIC_VERSION_30, QUIC_VERSION_31, QUIC_VERSION_32, QUIC_VERSION_33,
289 QUIC_VERSION_34, QUIC_VERSION_35, QUIC_VERSION_36}; 289 QUIC_VERSION_34, QUIC_VERSION_35, QUIC_VERSION_36};
290 290
291 FLAGS_quic_disable_pre_32 = true;
291 FLAGS_quic_enable_version_35 = false; 292 FLAGS_quic_enable_version_35 = false;
292 FLAGS_quic_enable_version_36_v2 = false; 293 FLAGS_quic_enable_version_36_v2 = false;
293 294
294 QuicVersionVector filtered_versions = FilterSupportedVersions(all_versions); 295 QuicVersionVector filtered_versions = FilterSupportedVersions(all_versions);
295 ASSERT_EQ(5u, filtered_versions.size()); 296 ASSERT_EQ(3u, filtered_versions.size());
296 EXPECT_EQ(QUIC_VERSION_30, filtered_versions[0]); 297 EXPECT_EQ(QUIC_VERSION_32, filtered_versions[0]);
297 EXPECT_EQ(QUIC_VERSION_31, filtered_versions[1]); 298 EXPECT_EQ(QUIC_VERSION_33, filtered_versions[1]);
298 EXPECT_EQ(QUIC_VERSION_32, filtered_versions[2]); 299 EXPECT_EQ(QUIC_VERSION_34, filtered_versions[2]);
299 EXPECT_EQ(QUIC_VERSION_33, filtered_versions[3]);
300 EXPECT_EQ(QUIC_VERSION_34, filtered_versions[4]);
301 } 300 }
302 301
303 TEST(QuicProtocolTest, QuicVersionManager) { 302 TEST(QuicProtocolTest, QuicVersionManager) {
304 FLAGS_quic_enable_version_35 = false; 303 FLAGS_quic_enable_version_35 = false;
305 FLAGS_quic_enable_version_36_v2 = false; 304 FLAGS_quic_enable_version_36_v2 = false;
306 QuicVersionManager manager(AllSupportedVersions()); 305 QuicVersionManager manager(AllSupportedVersions());
307 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), 306 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()),
308 manager.GetSupportedVersions()); 307 manager.GetSupportedVersions());
309 FLAGS_quic_enable_version_35 = true; 308 FLAGS_quic_enable_version_35 = true;
310 FLAGS_quic_enable_version_36_v2 = true; 309 FLAGS_quic_enable_version_36_v2 = true;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 EXPECT_EQ(2u, queue.NumIntervals()); 449 EXPECT_EQ(2u, queue.NumIntervals());
451 EXPECT_TRUE(queue.Contains(10)); 450 EXPECT_TRUE(queue.Contains(10));
452 EXPECT_TRUE(queue.Contains(11)); 451 EXPECT_TRUE(queue.Contains(11));
453 EXPECT_TRUE(queue.Contains(20)); 452 EXPECT_TRUE(queue.Contains(20));
454 EXPECT_TRUE(queue.Contains(21)); 453 EXPECT_TRUE(queue.Contains(21));
455 } 454 }
456 455
457 } // namespace 456 } // namespace
458 } // namespace test 457 } // namespace test
459 } // namespace net 458 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_protocol.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698