OLD | NEW |
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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 EXPECT_EQ(QUIC_VERSION_30, filtered_versions[0]); | 296 EXPECT_EQ(QUIC_VERSION_30, filtered_versions[0]); |
297 EXPECT_EQ(QUIC_VERSION_31, filtered_versions[1]); | 297 EXPECT_EQ(QUIC_VERSION_31, filtered_versions[1]); |
298 EXPECT_EQ(QUIC_VERSION_32, filtered_versions[2]); | 298 EXPECT_EQ(QUIC_VERSION_32, filtered_versions[2]); |
299 EXPECT_EQ(QUIC_VERSION_33, filtered_versions[3]); | 299 EXPECT_EQ(QUIC_VERSION_33, filtered_versions[3]); |
300 EXPECT_EQ(QUIC_VERSION_34, filtered_versions[4]); | 300 EXPECT_EQ(QUIC_VERSION_34, filtered_versions[4]); |
301 } | 301 } |
302 | 302 |
303 TEST(QuicProtocolTest, QuicVersionManager) { | 303 TEST(QuicProtocolTest, QuicVersionManager) { |
304 FLAGS_quic_enable_version_35 = false; | 304 FLAGS_quic_enable_version_35 = false; |
305 FLAGS_quic_enable_version_36 = false; | 305 FLAGS_quic_enable_version_36 = false; |
306 QuicVersionManager manager(QuicSupportedVersions()); | 306 QuicVersionManager manager(AllSupportedVersions()); |
307 EXPECT_EQ(FilterSupportedVersions(QuicSupportedVersions()), | 307 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), |
308 manager.GetSupportedVersions()); | 308 manager.GetSupportedVersions()); |
309 FLAGS_quic_enable_version_35 = true; | 309 FLAGS_quic_enable_version_35 = true; |
310 FLAGS_quic_enable_version_36 = true; | 310 FLAGS_quic_enable_version_36 = true; |
311 EXPECT_EQ(FilterSupportedVersions(QuicSupportedVersions()), | 311 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), |
312 manager.GetSupportedVersions()); | 312 manager.GetSupportedVersions()); |
313 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[0]); | 313 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[0]); |
314 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[1]); | 314 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[1]); |
315 } | 315 } |
316 | 316 |
317 TEST(QuicProtocolTest, LookUpVersionByIndex) { | 317 TEST(QuicProtocolTest, LookUpVersionByIndex) { |
318 QuicVersionVector all_versions = { | 318 QuicVersionVector all_versions = { |
319 QUIC_VERSION_30, QUIC_VERSION_31, QUIC_VERSION_32, QUIC_VERSION_33, | 319 QUIC_VERSION_30, QUIC_VERSION_31, QUIC_VERSION_32, QUIC_VERSION_33, |
320 QUIC_VERSION_34, QUIC_VERSION_35, QUIC_VERSION_36}; | 320 QUIC_VERSION_34, QUIC_VERSION_35, QUIC_VERSION_36}; |
321 int version_count = all_versions.size(); | 321 int version_count = all_versions.size(); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 EXPECT_EQ(2u, queue.NumIntervals()); | 450 EXPECT_EQ(2u, queue.NumIntervals()); |
451 EXPECT_TRUE(queue.Contains(10)); | 451 EXPECT_TRUE(queue.Contains(10)); |
452 EXPECT_TRUE(queue.Contains(11)); | 452 EXPECT_TRUE(queue.Contains(11)); |
453 EXPECT_TRUE(queue.Contains(20)); | 453 EXPECT_TRUE(queue.Contains(20)); |
454 EXPECT_TRUE(queue.Contains(21)); | 454 EXPECT_TRUE(queue.Contains(21)); |
455 } | 455 } |
456 | 456 |
457 } // namespace | 457 } // namespace |
458 } // namespace test | 458 } // namespace test |
459 } // namespace net | 459 } // namespace net |
OLD | NEW |