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

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

Issue 350973003: Killing off quic V17. Not flag protected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_session.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 "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace net { 10 namespace net {
11 namespace test { 11 namespace test {
12 namespace { 12 namespace {
13 13
14 TEST(QuicProtocolTest, AdjustErrorForVersion) { 14 TEST(QuicProtocolTest, AdjustErrorForVersion) {
15 ASSERT_EQ(8, QUIC_STREAM_LAST_ERROR) 15 ASSERT_EQ(8, QUIC_STREAM_LAST_ERROR)
16 << "Any additions to QuicRstStreamErrorCode require an addition to " 16 << "Any additions to QuicRstStreamErrorCode require an addition to "
17 << "AdjustErrorForVersion and this associated test."; 17 << "AdjustErrorForVersion and this associated test.";
18 18
19 EXPECT_EQ(QUIC_STREAM_NO_ERROR, 19 EXPECT_EQ(QUIC_STREAM_NO_ERROR,
20 AdjustErrorForVersion(QUIC_RST_FLOW_CONTROL_ACCOUNTING, 20 AdjustErrorForVersion(QUIC_RST_FLOW_CONTROL_ACCOUNTING,
21 QUIC_VERSION_17)); 21 QUIC_VERSION_16));
22 EXPECT_EQ(QUIC_RST_FLOW_CONTROL_ACCOUNTING, AdjustErrorForVersion( 22 EXPECT_EQ(QUIC_RST_FLOW_CONTROL_ACCOUNTING, AdjustErrorForVersion(
23 QUIC_RST_FLOW_CONTROL_ACCOUNTING, 23 QUIC_RST_FLOW_CONTROL_ACCOUNTING,
24 static_cast<QuicVersion>(QUIC_VERSION_17 + 1))); 24 QUIC_VERSION_18));
25 } 25 }
26 26
27 TEST(QuicProtocolTest, MakeQuicTag) { 27 TEST(QuicProtocolTest, MakeQuicTag) {
28 QuicTag tag = MakeQuicTag('A', 'B', 'C', 'D'); 28 QuicTag tag = MakeQuicTag('A', 'B', 'C', 'D');
29 char bytes[4]; 29 char bytes[4];
30 memcpy(bytes, &tag, 4); 30 memcpy(bytes, &tag, 4);
31 EXPECT_EQ('A', bytes[0]); 31 EXPECT_EQ('A', bytes[0]);
32 EXPECT_EQ('B', bytes[1]); 32 EXPECT_EQ('B', bytes[1]);
33 EXPECT_EQ('C', bytes[2]); 33 EXPECT_EQ('C', bytes[2]);
34 EXPECT_EQ('D', bytes[3]); 34 EXPECT_EQ('D', bytes[3]);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // Make sure that all supported versions are present in QuicVersionToString. 162 // Make sure that all supported versions are present in QuicVersionToString.
163 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { 163 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) {
164 QuicVersion version = kSupportedQuicVersions[i]; 164 QuicVersion version = kSupportedQuicVersions[i];
165 EXPECT_NE("QUIC_VERSION_UNSUPPORTED", QuicVersionToString(version)); 165 EXPECT_NE("QUIC_VERSION_UNSUPPORTED", QuicVersionToString(version));
166 } 166 }
167 } 167 }
168 168
169 } // namespace 169 } // namespace
170 } // namespace test 170 } // namespace test
171 } // namespace net 171 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698