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

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

Issue 2515613002: deprecate FLAGS_quic_disable_pre_34 (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/test_tools/quic_test_utils.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 public: 45 public:
46 ChloExtractorTest() { 46 ChloExtractorTest() {
47 header_.public_header.connection_id = 42; 47 header_.public_header.connection_id = 42;
48 header_.public_header.connection_id_length = PACKET_8BYTE_CONNECTION_ID; 48 header_.public_header.connection_id_length = PACKET_8BYTE_CONNECTION_ID;
49 header_.public_header.version_flag = true; 49 header_.public_header.version_flag = true;
50 header_.public_header.versions = 50 header_.public_header.versions =
51 SupportedVersions(AllSupportedVersions().front()); 51 SupportedVersions(AllSupportedVersions().front());
52 header_.public_header.reset_flag = false; 52 header_.public_header.reset_flag = false;
53 header_.public_header.packet_number_length = PACKET_6BYTE_PACKET_NUMBER; 53 header_.public_header.packet_number_length = PACKET_6BYTE_PACKET_NUMBER;
54 header_.packet_number = 1; 54 header_.packet_number = 1;
55 header_.entropy_flag = false;
56 header_.entropy_hash = 0;
57 } 55 }
58 56
59 void MakePacket(QuicStreamFrame* stream_frame) { 57 void MakePacket(QuicStreamFrame* stream_frame) {
60 QuicFrame frame(stream_frame); 58 QuicFrame frame(stream_frame);
61 QuicFrames frames; 59 QuicFrames frames;
62 frames.push_back(frame); 60 frames.push_back(frame);
63 QuicFramer framer(SupportedVersions(header_.public_header.versions.front()), 61 QuicFramer framer(SupportedVersions(header_.public_header.versions.front()),
64 QuicTime::Zero(), Perspective::IS_CLIENT); 62 QuicTime::Zero(), Perspective::IS_CLIENT);
65 std::unique_ptr<QuicPacket> packet( 63 std::unique_ptr<QuicPacket> packet(
66 BuildUnsizedDataPacket(&framer, header_, frames)); 64 BuildUnsizedDataPacket(&framer, header_, frames));
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 125
128 TEST_F(ChloExtractorTest, DoesNotFindInvalidChlo) { 126 TEST_F(ChloExtractorTest, DoesNotFindInvalidChlo) {
129 MakePacket(new QuicStreamFrame(kCryptoStreamId, false, 0, "foo")); 127 MakePacket(new QuicStreamFrame(kCryptoStreamId, false, 0, "foo"));
130 EXPECT_FALSE( 128 EXPECT_FALSE(
131 ChloExtractor::Extract(*packet_, AllSupportedVersions(), &delegate_)); 129 ChloExtractor::Extract(*packet_, AllSupportedVersions(), &delegate_));
132 } 130 }
133 131
134 } // namespace 132 } // namespace
135 } // namespace test 133 } // namespace test
136 } // namespace net 134 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.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