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

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

Issue 2848203002: Add a platform implementation of QuicTest and QuicTestWithParam (Closed)
Patch Set: net/quic/platform/impl/quic_test_impl.cc Created 3 years, 7 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/simulator_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/platform/api/quic_test.h"
8 #include "net/quic/test_tools/crypto_test_utils.h" 9 #include "net/quic/test_tools/crypto_test_utils.h"
9 #include "net/quic/test_tools/quic_test_utils.h" 10 #include "net/quic/test_tools/quic_test_utils.h"
10 11
11 using std::string; 12 using std::string;
12 using testing::Return; 13 using testing::Return;
13 using testing::_; 14 using testing::_;
14 15
15 namespace net { 16 namespace net {
16 namespace test { 17 namespace test {
17 namespace { 18 namespace {
(...skipping 15 matching lines...) Expand all
33 QuicConnectionId connection_id() const { return connection_id_; } 34 QuicConnectionId connection_id() const { return connection_id_; }
34 QuicVersion version() const { return version_; } 35 QuicVersion version() const { return version_; }
35 const string& chlo() const { return chlo_; } 36 const string& chlo() const { return chlo_; }
36 37
37 private: 38 private:
38 QuicConnectionId connection_id_; 39 QuicConnectionId connection_id_;
39 QuicVersion version_; 40 QuicVersion version_;
40 string chlo_; 41 string chlo_;
41 }; 42 };
42 43
43 class ChloExtractorTest : public ::testing::Test { 44 class ChloExtractorTest : public QuicTest {
44 public: 45 public:
45 ChloExtractorTest() { 46 ChloExtractorTest() {
46 header_.public_header.connection_id = 42; 47 header_.public_header.connection_id = 42;
47 header_.public_header.connection_id_length = PACKET_8BYTE_CONNECTION_ID; 48 header_.public_header.connection_id_length = PACKET_8BYTE_CONNECTION_ID;
48 header_.public_header.version_flag = true; 49 header_.public_header.version_flag = true;
49 header_.public_header.versions = 50 header_.public_header.versions =
50 SupportedVersions(AllSupportedVersions().front()); 51 SupportedVersions(AllSupportedVersions().front());
51 header_.public_header.reset_flag = false; 52 header_.public_header.reset_flag = false;
52 header_.public_header.packet_number_length = PACKET_6BYTE_PACKET_NUMBER; 53 header_.public_header.packet_number_length = PACKET_6BYTE_PACKET_NUMBER;
53 header_.packet_number = 1; 54 header_.packet_number = 1;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 130
130 TEST_F(ChloExtractorTest, DoesNotFindInvalidChlo) { 131 TEST_F(ChloExtractorTest, DoesNotFindInvalidChlo) {
131 MakePacket(new QuicStreamFrame(kCryptoStreamId, false, 0, "foo")); 132 MakePacket(new QuicStreamFrame(kCryptoStreamId, false, 0, "foo"));
132 EXPECT_FALSE( 133 EXPECT_FALSE(
133 ChloExtractor::Extract(*packet_, AllSupportedVersions(), &delegate_)); 134 ChloExtractor::Extract(*packet_, AllSupportedVersions(), &delegate_));
134 } 135 }
135 136
136 } // namespace 137 } // namespace
137 } // namespace test 138 } // namespace test
138 } // namespace net 139 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/simulator/simulator_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