| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_version_manager.h" | 5 #include "net/quic/core/quic_version_manager.h" |
| 6 | 6 |
| 7 #include "net/quic/core/quic_flags.h" | 7 #include "net/quic/core/quic_flags.h" |
| 8 #include "net/quic/core/quic_versions.h" | 8 #include "net/quic/core/quic_versions.h" |
| 9 #include "net/quic/test_tools/quic_test_utils.h" | 9 #include "net/quic/test_tools/quic_test_utils.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 FLAGS_quic_reloadable_flag_quic_enable_version_38 = true; | 44 FLAGS_quic_reloadable_flag_quic_enable_version_38 = true; |
| 45 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), | 45 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), |
| 46 manager.GetSupportedVersions()); | 46 manager.GetSupportedVersions()); |
| 47 ASSERT_EQ(5u, manager.GetSupportedVersions().size()); | 47 ASSERT_EQ(5u, manager.GetSupportedVersions().size()); |
| 48 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[0]); | 48 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[0]); |
| 49 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[1]); | 49 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[1]); |
| 50 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[2]); | 50 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[2]); |
| 51 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[3]); | 51 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[3]); |
| 52 EXPECT_EQ(QUIC_VERSION_34, manager.GetSupportedVersions()[4]); | 52 EXPECT_EQ(QUIC_VERSION_34, manager.GetSupportedVersions()[4]); |
| 53 | 53 |
| 54 base::SetFlag(&FLAGS_quic_enable_version_39, true); |
| 55 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), |
| 56 manager.GetSupportedVersions()); |
| 57 ASSERT_EQ(6u, manager.GetSupportedVersions().size()); |
| 58 EXPECT_EQ(QUIC_VERSION_39, manager.GetSupportedVersions()[0]); |
| 59 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[1]); |
| 60 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[2]); |
| 61 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[3]); |
| 62 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[4]); |
| 63 EXPECT_EQ(QUIC_VERSION_34, manager.GetSupportedVersions()[5]); |
| 64 |
| 54 FLAGS_quic_reloadable_flag_quic_disable_version_34 = true; | 65 FLAGS_quic_reloadable_flag_quic_disable_version_34 = true; |
| 55 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), | 66 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), |
| 56 manager.GetSupportedVersions()); | 67 manager.GetSupportedVersions()); |
| 57 ASSERT_EQ(4u, manager.GetSupportedVersions().size()); | 68 ASSERT_EQ(5u, manager.GetSupportedVersions().size()); |
| 58 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[0]); | 69 EXPECT_EQ(QUIC_VERSION_39, manager.GetSupportedVersions()[0]); |
| 59 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[1]); | 70 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[1]); |
| 60 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[2]); | 71 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[2]); |
| 61 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[3]); | 72 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[3]); |
| 73 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[4]); |
| 62 } | 74 } |
| 63 | 75 |
| 64 } // namespace | 76 } // namespace |
| 65 } // namespace test | 77 } // namespace test |
| 66 } // namespace net | 78 } // namespace net |
| OLD | NEW |