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

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

Issue 47283002: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation error Created 7 years, 1 month 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.h » ('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 {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 EXPECT_EQ(QUIC_VERSION_UNSUPPORTED, 125 EXPECT_EQ(QUIC_VERSION_UNSUPPORTED,
126 QuicTagToQuicVersion(MakeQuicTag('F', 'A', 'K', 'E'))); 126 QuicTagToQuicVersion(MakeQuicTag('F', 'A', 'K', 'E')));
127 } 127 }
128 128
129 TEST(QuicProtocolTest, QuicVersionToString) { 129 TEST(QuicProtocolTest, QuicVersionToString) {
130 EXPECT_EQ("QUIC_VERSION_10", QuicVersionToString(QUIC_VERSION_10)); 130 EXPECT_EQ("QUIC_VERSION_10", QuicVersionToString(QUIC_VERSION_10));
131 EXPECT_EQ("QUIC_VERSION_UNSUPPORTED", 131 EXPECT_EQ("QUIC_VERSION_UNSUPPORTED",
132 QuicVersionToString(QUIC_VERSION_UNSUPPORTED)); 132 QuicVersionToString(QUIC_VERSION_UNSUPPORTED));
133 133
134 QuicVersion single_version[] = {QUIC_VERSION_10}; 134 QuicVersion single_version[] = {QUIC_VERSION_10};
135 EXPECT_EQ("QUIC_VERSION_10,", 135 QuicVersionVector versions_vector;
136 QuicVersionArrayToString(single_version, 136 for (size_t i = 0; i < arraysize(single_version); ++i) {
137 arraysize(single_version))); 137 versions_vector.push_back(single_version[i]);
138 }
139 EXPECT_EQ("QUIC_VERSION_10", QuicVersionVectorToString(versions_vector));
140
138 QuicVersion multiple_versions[] = {QUIC_VERSION_11, QUIC_VERSION_10}; 141 QuicVersion multiple_versions[] = {QUIC_VERSION_11, QUIC_VERSION_10};
139 EXPECT_EQ("QUIC_VERSION_11,QUIC_VERSION_10,", 142 versions_vector.clear();
140 QuicVersionArrayToString(multiple_versions, 143 for (size_t i = 0; i < arraysize(multiple_versions); ++i) {
141 arraysize(multiple_versions))); 144 versions_vector.push_back(multiple_versions[i]);
145 }
146 EXPECT_EQ("QUIC_VERSION_11,QUIC_VERSION_10",
147 QuicVersionVectorToString(versions_vector));
142 148
143 // Make sure that all supported versions are present in QuicVersionToString. 149 // Make sure that all supported versions are present in QuicVersionToString.
144 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { 150 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) {
145 QuicVersion version = kSupportedQuicVersions[i]; 151 QuicVersion version = kSupportedQuicVersions[i];
146 EXPECT_NE("QUIC_VERSION_UNSUPPORTED", QuicVersionToString(version)); 152 EXPECT_NE("QUIC_VERSION_UNSUPPORTED", QuicVersionToString(version));
147 } 153 }
148 } 154 }
149 155
150 } // namespace 156 } // namespace
151 } // namespace test 157 } // namespace test
152 } // namespace net 158 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.cc ('k') | net/quic/quic_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698