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

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

Issue 2100863003: Disable QUIC v29 and earlier. Protected by FLAGS_quic_disable_pre_30. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Fixing compile error on android. Created 4 years, 5 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/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/quic_protocol.h" 5 #include "net/quic/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/quic_flags.h"
10 #include "net/quic/quic_utils.h" 11 #include "net/quic/quic_utils.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 namespace net { 14 namespace net {
14 namespace test { 15 namespace test {
15 namespace { 16 namespace {
16 17
17 TEST(QuicProtocolTest, AdjustErrorForVersion) { 18 TEST(QuicProtocolTest, AdjustErrorForVersion) {
18 ASSERT_EQ(14, QUIC_STREAM_LAST_ERROR) 19 ASSERT_EQ(14, QUIC_STREAM_LAST_ERROR)
19 << "Any additions to QuicRstStreamErrorCode require an addition to " 20 << "Any additions to QuicRstStreamErrorCode require an addition to "
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 276 }
276 277
277 TEST(QuicProtocolTest, PathCloseFrameToString) { 278 TEST(QuicProtocolTest, PathCloseFrameToString) {
278 QuicPathCloseFrame frame; 279 QuicPathCloseFrame frame;
279 frame.path_id = 1; 280 frame.path_id = 1;
280 std::ostringstream stream; 281 std::ostringstream stream;
281 stream << frame; 282 stream << frame;
282 EXPECT_EQ("{ path_id: 1 }\n", stream.str()); 283 EXPECT_EQ("{ path_id: 1 }\n", stream.str());
283 } 284 }
284 285
286 TEST(QuicProtocolTest, FilterSupportedVersions) {
287 QuicVersionVector all_versions = {QUIC_VERSION_25, QUIC_VERSION_26,
288 QUIC_VERSION_27, QUIC_VERSION_29,
289 QUIC_VERSION_30};
290
291 FLAGS_quic_disable_pre_30 = true;
292 QuicVersionVector filtered_versions = FilterSupportedVersions(all_versions);
293 ASSERT_EQ(1u, filtered_versions.size());
294 EXPECT_EQ(QUIC_VERSION_30, filtered_versions[0]);
295 }
296
285 // Tests that a queue contains the expected data after calls to Add(). 297 // Tests that a queue contains the expected data after calls to Add().
286 TEST(PacketNumberQueueTest, AddRange) { 298 TEST(PacketNumberQueueTest, AddRange) {
287 PacketNumberQueue queue; 299 PacketNumberQueue queue;
288 queue.Add(1, 51); 300 queue.Add(1, 51);
289 queue.Add(53); 301 queue.Add(53);
290 302
291 EXPECT_FALSE(queue.Contains(0)); 303 EXPECT_FALSE(queue.Contains(0));
292 for (int i = 1; i < 51; ++i) { 304 for (int i = 1; i < 51; ++i) {
293 EXPECT_TRUE(queue.Contains(i)); 305 EXPECT_TRUE(queue.Contains(i));
294 } 306 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 EXPECT_EQ(10u, queue.LastIntervalLength()); 396 EXPECT_EQ(10u, queue.LastIntervalLength());
385 queue.Remove(9, 21); 397 queue.Remove(9, 21);
386 EXPECT_EQ(3u, queue.NumIntervals()); 398 EXPECT_EQ(3u, queue.NumIntervals());
387 EXPECT_FALSE(queue.Contains(9)); 399 EXPECT_FALSE(queue.Contains(9));
388 EXPECT_FALSE(queue.Contains(20)); 400 EXPECT_FALSE(queue.Contains(20));
389 } 401 }
390 402
391 } // namespace 403 } // namespace
392 } // namespace test 404 } // namespace test
393 } // namespace net 405 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/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