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

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

Issue 2517513004: Move QUIC error code utility methods to quic_error_codes.{h,cc}, and rename them slightly. No beha… (Closed)
Patch Set: Created 4 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
« no previous file with comments | « net/quic/core/quic_utils.cc ('k') | net/tools/quic/quic_client_bin.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_utils.h" 5 #include "net/quic/core/quic_utils.h"
6 6
7 #include "net/quic/core/crypto/crypto_protocol.h" 7 #include "net/quic/core/crypto/crypto_protocol.h"
8 #include "net/quic/core/quic_flags.h" 8 #include "net/quic/core/quic_flags.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 using base::StringPiece; 11 using base::StringPiece;
12 using std::string; 12 using std::string;
13 13
14 namespace net { 14 namespace net {
15 namespace test { 15 namespace test {
16 namespace { 16 namespace {
17 17
18 TEST(QuicUtilsTest, StreamErrorToString) {
19 EXPECT_STREQ("QUIC_BAD_APPLICATION_PAYLOAD",
20 QuicUtils::StreamErrorToString(QUIC_BAD_APPLICATION_PAYLOAD));
21 }
22
23 TEST(QuicUtilsTest, ErrorToString) {
24 EXPECT_STREQ("QUIC_NO_ERROR", QuicUtils::ErrorToString(QUIC_NO_ERROR));
25 }
26
27 TEST(QuicUtilsTest, ParseQuicConnectionOptions) { 18 TEST(QuicUtilsTest, ParseQuicConnectionOptions) {
28 QuicTagVector empty_options = QuicUtils::ParseQuicConnectionOptions(""); 19 QuicTagVector empty_options = QuicUtils::ParseQuicConnectionOptions("");
29 EXPECT_EQ(0ul, empty_options.size()); 20 EXPECT_EQ(0ul, empty_options.size());
30 21
31 QuicTagVector parsed_options = 22 QuicTagVector parsed_options =
32 QuicUtils::ParseQuicConnectionOptions("TIMER,TBBR,REJ"); 23 QuicUtils::ParseQuicConnectionOptions("TIMER,TBBR,REJ");
33 QuicTagVector expected_options; 24 QuicTagVector expected_options;
34 expected_options.push_back(kTIME); 25 expected_options.push_back(kTIME);
35 expected_options.push_back(kTBBR); 26 expected_options.push_back(kTBBR);
36 expected_options.push_back(kREJ); 27 expected_options.push_back(kREJ);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 "0x0010: 7320 7374 7269 6e67 2073 686f 756c 6420 s.string.should.\n" 130 "0x0010: 7320 7374 7269 6e67 2073 686f 756c 6420 s.string.should.\n"
140 "0x0020: 6265 206c 6f6e 6720 656e 6f75 6768 2074 be.long.enough.t\n" 131 "0x0020: 6265 206c 6f6e 6720 656e 6f75 6768 2074 be.long.enough.t\n"
141 "0x0030: 6f20 7370 616e 206d 756c 7469 706c 6520 o.span.multiple.\n" 132 "0x0030: 6f20 7370 616e 206d 756c 7469 706c 6520 o.span.multiple.\n"
142 "0x0040: 6c69 6e65 7320 6f66 206f 7574 7075 742e lines.of.output.\n" 133 "0x0040: 6c69 6e65 7320 6f66 206f 7574 7075 742e lines.of.output.\n"
143 "0x0050: 0102 03 ...\n"); 134 "0x0050: 0102 03 ...\n");
144 } 135 }
145 136
146 } // namespace 137 } // namespace
147 } // namespace test 138 } // namespace test
148 } // namespace net 139 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_utils.cc ('k') | net/tools/quic/quic_client_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698