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

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

Issue 2827503003: deprecate -FLAGS_quic_reloadable_flag_quic_enable_version_37 (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_versions.cc ('k') | net/tools/quic/quic_dispatcher_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_versions.h" 5 #include "net/quic/core/quic_versions.h"
6 6
7 #include "net/quic/core/quic_flags.h" 7 #include "net/quic/core/quic_flags.h"
8 #include "net/quic/test_tools/quic_test_utils.h" 8 #include "net/quic/test_tools/quic_test_utils.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 EXPECT_EQ("QUIC_VERSION_UNSUPPORTED,QUIC_VERSION_35", 118 EXPECT_EQ("QUIC_VERSION_UNSUPPORTED,QUIC_VERSION_35",
119 QuicVersionVectorToString(versions_vector)); 119 QuicVersionVectorToString(versions_vector));
120 120
121 // Make sure that all supported versions are present in QuicVersionToString. 121 // Make sure that all supported versions are present in QuicVersionToString.
122 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { 122 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) {
123 QuicVersion version = kSupportedQuicVersions[i]; 123 QuicVersion version = kSupportedQuicVersions[i];
124 EXPECT_NE("QUIC_VERSION_UNSUPPORTED", QuicVersionToString(version)); 124 EXPECT_NE("QUIC_VERSION_UNSUPPORTED", QuicVersionToString(version));
125 } 125 }
126 } 126 }
127 127
128 TEST(QuicVersionsTest, FilterSupportedVersionsNo37) { 128 TEST(QuicVersionsTest, FilterSupportedVersionsNo38) {
129 QuicFlagSaver flags; 129 QuicFlagSaver flags;
130 QuicVersionVector all_versions = {QUIC_VERSION_35, QUIC_VERSION_36, 130 QuicVersionVector all_versions = {QUIC_VERSION_35, QUIC_VERSION_36,
131 QUIC_VERSION_37}; 131 QUIC_VERSION_37, QUIC_VERSION_38,
132 QUIC_VERSION_39};
132 133
133 FLAGS_quic_reloadable_flag_quic_enable_version_37 = false; 134 FLAGS_quic_reloadable_flag_quic_enable_version_38 = false;
134 135
135 QuicVersionVector filtered_versions = FilterSupportedVersions(all_versions); 136 QuicVersionVector filtered_versions = FilterSupportedVersions(all_versions);
136 ASSERT_EQ(2u, filtered_versions.size()); 137 ASSERT_EQ(3u, filtered_versions.size());
137 EXPECT_EQ(QUIC_VERSION_35, filtered_versions[0]); 138 EXPECT_EQ(QUIC_VERSION_35, filtered_versions[0]);
138 EXPECT_EQ(QUIC_VERSION_36, filtered_versions[1]); 139 EXPECT_EQ(QUIC_VERSION_36, filtered_versions[1]);
140 EXPECT_EQ(QUIC_VERSION_37, filtered_versions[2]);
141 }
142
143 TEST(QuicVersionsTest, FilterSupportedVersionsNo39) {
144 QuicVersionVector all_versions = {QUIC_VERSION_35, QUIC_VERSION_36,
145 QUIC_VERSION_37, QUIC_VERSION_38,
146 QUIC_VERSION_39};
147
148 FLAGS_quic_reloadable_flag_quic_enable_version_38 = true;
149 base::SetFlag(&FLAGS_quic_enable_version_39, false);
150
151 QuicVersionVector filtered_versions = FilterSupportedVersions(all_versions);
152 ASSERT_EQ(4u, filtered_versions.size());
153 EXPECT_EQ(QUIC_VERSION_35, filtered_versions[0]);
154 EXPECT_EQ(QUIC_VERSION_36, filtered_versions[1]);
155 EXPECT_EQ(QUIC_VERSION_37, filtered_versions[2]);
156 EXPECT_EQ(QUIC_VERSION_38, filtered_versions[3]);
139 } 157 }
140 158
141 TEST(QuicVersionsTest, FilterSupportedVersionsAllVersions) { 159 TEST(QuicVersionsTest, FilterSupportedVersionsAllVersions) {
142 QuicFlagSaver flags; 160 QuicFlagSaver flags;
143 QuicVersionVector all_versions = {QUIC_VERSION_35, QUIC_VERSION_36, 161 QuicVersionVector all_versions = {QUIC_VERSION_35, QUIC_VERSION_36,
144 QUIC_VERSION_37}; 162 QUIC_VERSION_37, QUIC_VERSION_38,
163 QUIC_VERSION_39};
145 164
146 FLAGS_quic_reloadable_flag_quic_enable_version_37 = true; 165 FLAGS_quic_reloadable_flag_quic_enable_version_38 = true;
166 base::SetFlag(&FLAGS_quic_enable_version_39, true);
147 167
148 QuicVersionVector filtered_versions = FilterSupportedVersions(all_versions); 168 QuicVersionVector filtered_versions = FilterSupportedVersions(all_versions);
149 ASSERT_EQ(all_versions, filtered_versions); 169 ASSERT_EQ(all_versions, filtered_versions);
150 } 170 }
151 171
152 TEST(QuicVersionsTest, LookUpVersionByIndex) { 172 TEST(QuicVersionsTest, LookUpVersionByIndex) {
153 QuicVersionVector all_versions = {QUIC_VERSION_35, QUIC_VERSION_36, 173 QuicVersionVector all_versions = {QUIC_VERSION_35, QUIC_VERSION_36,
154 QUIC_VERSION_37}; 174 QUIC_VERSION_37, QUIC_VERSION_38,
175 QUIC_VERSION_39};
155 int version_count = all_versions.size(); 176 int version_count = all_versions.size();
156 for (int i = -5; i <= version_count + 1; ++i) { 177 for (int i = -5; i <= version_count + 1; ++i) {
157 if (i >= 0 && i < version_count) { 178 if (i >= 0 && i < version_count) {
158 EXPECT_EQ(all_versions[i], VersionOfIndex(all_versions, i)[0]); 179 EXPECT_EQ(all_versions[i], VersionOfIndex(all_versions, i)[0]);
159 } else { 180 } else {
160 EXPECT_EQ(QUIC_VERSION_UNSUPPORTED, VersionOfIndex(all_versions, i)[0]); 181 EXPECT_EQ(QUIC_VERSION_UNSUPPORTED, VersionOfIndex(all_versions, i)[0]);
161 } 182 }
162 } 183 }
163 } 184 }
164 185
165 } // namespace 186 } // namespace
166 } // namespace test 187 } // namespace test
167 } // namespace net 188 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_versions.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698