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

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

Issue 2236973002: Landing Recent QUIC changes until 4AM, Aug 7, 2016 UTC-4 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: flip quic_sequencer_buffer_retire_block_in_time to true Created 4 years, 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 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/stateless_rejector.h" 5 #include "net/tools/quic/stateless_rejector.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "net/quic/core/crypto/crypto_handshake_message.h" 10 #include "net/quic/core/crypto/crypto_handshake_message.h"
(...skipping 24 matching lines...) Expand all
35 friend ostream& operator<<(ostream& os, const TestParams& p) { 35 friend ostream& operator<<(ostream& os, const TestParams& p) {
36 os << "{ version: " << p.version << " flags: " << p.flags << " }"; 36 os << "{ version: " << p.version << " flags: " << p.flags << " }";
37 return os; 37 return os;
38 } 38 }
39 }; 39 };
40 40
41 vector<TestParams> GetTestParams() { 41 vector<TestParams> GetTestParams() {
42 vector<TestParams> params; 42 vector<TestParams> params;
43 for (FlagsMode flags : 43 for (FlagsMode flags :
44 {ENABLED, STATELESS_DISABLED, CHEAP_DISABLED, BOTH_DISABLED}) { 44 {ENABLED, STATELESS_DISABLED, CHEAP_DISABLED, BOTH_DISABLED}) {
45 for (QuicVersion version : QuicSupportedVersions()) { 45 for (QuicVersion version : AllSupportedVersions()) {
46 TestParams param; 46 TestParams param;
47 param.version = version; 47 param.version = version;
48 param.flags = flags; 48 param.flags = flags;
49 params.push_back(param); 49 params.push_back(param);
50 } 50 }
51 } 51 }
52 return params; 52 return params;
53 } 53 }
54 54
55 class StatelessRejectorTest : public ::testing::TestWithParam<TestParams> { 55 class StatelessRejectorTest : public ::testing::TestWithParam<TestParams> {
56 public: 56 public:
57 StatelessRejectorTest() 57 StatelessRejectorTest()
58 : proof_source_(CryptoTestUtils::ProofSourceForTesting()), 58 : proof_source_(CryptoTestUtils::ProofSourceForTesting()),
59 config_(QuicCryptoServerConfig::TESTING, 59 config_(QuicCryptoServerConfig::TESTING,
60 QuicRandom::GetInstance(), 60 QuicRandom::GetInstance(),
61 CryptoTestUtils::ProofSourceForTesting()), 61 CryptoTestUtils::ProofSourceForTesting()),
62 config_peer_(&config_), 62 config_peer_(&config_),
63 compressed_certs_cache_( 63 compressed_certs_cache_(
64 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize), 64 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize),
65 rejector_(GetParam().version, 65 rejector_(GetParam().version,
66 QuicSupportedVersions(), 66 AllSupportedVersions(),
67 &config_, 67 &config_,
68 &compressed_certs_cache_, 68 &compressed_certs_cache_,
69 &clock_, 69 &clock_,
70 QuicRandom::GetInstance(), 70 QuicRandom::GetInstance(),
71 kDefaultMaxPacketSize,
71 IPEndPoint(net::test::Loopback4(), 12345), 72 IPEndPoint(net::test::Loopback4(), 12345),
72 IPEndPoint(net::test::Loopback4(), 443)) { 73 IPEndPoint(net::test::Loopback4(), 443)) {
73 FLAGS_enable_quic_stateless_reject_support = 74 FLAGS_enable_quic_stateless_reject_support =
74 GetParam().flags == ENABLED || GetParam().flags == CHEAP_DISABLED; 75 GetParam().flags == ENABLED || GetParam().flags == CHEAP_DISABLED;
75 FLAGS_quic_use_cheap_stateless_rejects = 76 FLAGS_quic_use_cheap_stateless_rejects =
76 GetParam().flags == ENABLED || GetParam().flags == STATELESS_DISABLED; 77 GetParam().flags == ENABLED || GetParam().flags == STATELESS_DISABLED;
77 78
78 // Add a new primary config. 79 // Add a new primary config.
79 std::unique_ptr<CryptoHandshakeMessage> msg(config_.AddDefaultConfig( 80 std::unique_ptr<CryptoHandshakeMessage> msg(config_.AddDefaultConfig(
80 QuicRandom::GetInstance(), &clock_, config_options_)); 81 QuicRandom::GetInstance(), &clock_, config_options_));
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 if (GetParam().flags != ENABLED || GetParam().version <= QUIC_VERSION_32) { 233 if (GetParam().flags != ENABLED || GetParam().version <= QUIC_VERSION_32) {
233 EXPECT_EQ(StatelessRejector::UNSUPPORTED, rejector_.state()); 234 EXPECT_EQ(StatelessRejector::UNSUPPORTED, rejector_.state());
234 return; 235 return;
235 } 236 }
236 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_.state()); 237 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_.state());
237 } 238 }
238 239
239 } // namespace 240 } // namespace
240 } // namespace test 241 } // namespace test
241 } // namespace net 242 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/stateless_rejector.cc ('k') | net/tools/quic/test_tools/packet_reordering_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698