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

Side by Side Diff: net/tools/quic/chlo_extractor_test.cc

Issue 2808273006: Landing Recent QUIC changes until Sun Apr 9 16:12:55 (Closed)
Patch Set: increment enabled_options in e2e test 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/test_tools/simulator/quic_endpoint_test.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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/tools/quic/chlo_extractor.h" 5 #include "net/tools/quic/chlo_extractor.h"
6 6
7 #include "net/quic/core/quic_framer.h" 7 #include "net/quic/core/quic_framer.h"
8 #include "net/quic/test_tools/crypto_test_utils.h" 8 #include "net/quic/test_tools/crypto_test_utils.h"
9 #include "net/quic/test_tools/quic_test_utils.h" 9 #include "net/quic/test_tools/quic_test_utils.h"
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 .as_string()); 87 .as_string());
88 // Construct a CHLO with each supported version 88 // Construct a CHLO with each supported version
89 for (QuicVersion version : AllSupportedVersions()) { 89 for (QuicVersion version : AllSupportedVersions()) {
90 QuicVersionVector versions(SupportedVersions(version)); 90 QuicVersionVector versions(SupportedVersions(version));
91 header_.public_header.versions = versions; 91 header_.public_header.versions = versions;
92 MakePacket( 92 MakePacket(
93 new QuicStreamFrame(kCryptoStreamId, false, 0, client_hello_str)); 93 new QuicStreamFrame(kCryptoStreamId, false, 0, client_hello_str));
94 EXPECT_TRUE(ChloExtractor::Extract(*packet_, versions, &delegate_)) 94 EXPECT_TRUE(ChloExtractor::Extract(*packet_, versions, &delegate_))
95 << QuicVersionToString(version); 95 << QuicVersionToString(version);
96 EXPECT_EQ(version, delegate_.version()); 96 EXPECT_EQ(version, delegate_.version());
97 EXPECT_EQ(header_.public_header.connection_id, delegate_.connection_id()); 97 EXPECT_EQ(GetPeerInMemoryConnectionId(header_.public_header.connection_id),
98 delegate_.connection_id());
98 EXPECT_EQ(client_hello.DebugString(Perspective::IS_SERVER), 99 EXPECT_EQ(client_hello.DebugString(Perspective::IS_SERVER),
99 delegate_.chlo()) 100 delegate_.chlo())
100 << QuicVersionToString(version); 101 << QuicVersionToString(version);
101 } 102 }
102 } 103 }
103 104
104 TEST_F(ChloExtractorTest, DoesNotFindValidChloOnWrongStream) { 105 TEST_F(ChloExtractorTest, DoesNotFindValidChloOnWrongStream) {
105 CryptoHandshakeMessage client_hello; 106 CryptoHandshakeMessage client_hello;
106 client_hello.set_tag(kCHLO); 107 client_hello.set_tag(kCHLO);
107 108
(...skipping 20 matching lines...) Expand all
128 129
129 TEST_F(ChloExtractorTest, DoesNotFindInvalidChlo) { 130 TEST_F(ChloExtractorTest, DoesNotFindInvalidChlo) {
130 MakePacket(new QuicStreamFrame(kCryptoStreamId, false, 0, "foo")); 131 MakePacket(new QuicStreamFrame(kCryptoStreamId, false, 0, "foo"));
131 EXPECT_FALSE( 132 EXPECT_FALSE(
132 ChloExtractor::Extract(*packet_, AllSupportedVersions(), &delegate_)); 133 ChloExtractor::Extract(*packet_, AllSupportedVersions(), &delegate_));
133 } 134 }
134 135
135 } // namespace 136 } // namespace
136 } // namespace test 137 } // namespace test
137 } // namespace net 138 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/simulator/quic_endpoint_test.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