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

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

Issue 2820423002: Move quic_flags.h from net/quic/core to net/quic/platform and split into api and impl. (Closed)
Patch Set: Created 3 years, 8 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_version_manager.cc ('k') | net/quic/core/quic_versions.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) 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"
8 #include "net/quic/core/quic_versions.h" 7 #include "net/quic/core/quic_versions.h"
8 #include "net/quic/platform/api/quic_flags.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"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace net { 13 namespace net {
14 namespace test { 14 namespace test {
15 namespace { 15 namespace {
16 16
17 TEST(QuicVersionManagerTest, QuicVersionManager) { 17 TEST(QuicVersionManagerTest, QuicVersionManager) {
18 QuicFlagSaver flags; 18 QuicFlagSaver flags;
19 FLAGS_quic_reloadable_flag_quic_enable_version_38 = false; 19 FLAGS_quic_reloadable_flag_quic_enable_version_38 = false;
20 QuicVersionManager manager(AllSupportedVersions()); 20 QuicVersionManager manager(AllSupportedVersions());
21 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), 21 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()),
22 manager.GetSupportedVersions()); 22 manager.GetSupportedVersions());
23 23
24 FLAGS_quic_reloadable_flag_quic_enable_version_38 = true; 24 FLAGS_quic_reloadable_flag_quic_enable_version_38 = true;
25 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), 25 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()),
26 manager.GetSupportedVersions()); 26 manager.GetSupportedVersions());
27 ASSERT_EQ(4u, manager.GetSupportedVersions().size()); 27 ASSERT_EQ(4u, manager.GetSupportedVersions().size());
28 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[0]); 28 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[0]);
29 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[1]); 29 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[1]);
30 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[2]); 30 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[2]);
31 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[3]); 31 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[3]);
32 32
33 base::SetFlag(&FLAGS_quic_enable_version_39, true); 33 SetQuicFlag(&FLAGS_quic_enable_version_39, true);
34 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), 34 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()),
35 manager.GetSupportedVersions()); 35 manager.GetSupportedVersions());
36 ASSERT_EQ(5u, manager.GetSupportedVersions().size()); 36 ASSERT_EQ(5u, manager.GetSupportedVersions().size());
37 EXPECT_EQ(QUIC_VERSION_39, manager.GetSupportedVersions()[0]); 37 EXPECT_EQ(QUIC_VERSION_39, manager.GetSupportedVersions()[0]);
38 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[1]); 38 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[1]);
39 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[2]); 39 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[2]);
40 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[3]); 40 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[3]);
41 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[4]); 41 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[4]);
42 42
43 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()), 43 EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()),
44 manager.GetSupportedVersions()); 44 manager.GetSupportedVersions());
45 ASSERT_EQ(5u, manager.GetSupportedVersions().size()); 45 ASSERT_EQ(5u, manager.GetSupportedVersions().size());
46 EXPECT_EQ(QUIC_VERSION_39, manager.GetSupportedVersions()[0]); 46 EXPECT_EQ(QUIC_VERSION_39, manager.GetSupportedVersions()[0]);
47 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[1]); 47 EXPECT_EQ(QUIC_VERSION_38, manager.GetSupportedVersions()[1]);
48 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[2]); 48 EXPECT_EQ(QUIC_VERSION_37, manager.GetSupportedVersions()[2]);
49 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[3]); 49 EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[3]);
50 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[4]); 50 EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[4]);
51 } 51 }
52 52
53 } // namespace 53 } // namespace
54 } // namespace test 54 } // namespace test
55 } // namespace net 55 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_version_manager.cc ('k') | net/quic/core/quic_versions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698