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

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

Issue 2591143003: Add QuicStrCat. (Closed)
Patch Set: sync Created 3 years, 12 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/tools/quic/quic_http_response_cache_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "net/quic/core/crypto/crypto_handshake_message.h" 12 #include "net/quic/core/crypto/crypto_handshake_message.h"
13 #include "net/quic/core/crypto/proof_source.h" 13 #include "net/quic/core/crypto/proof_source.h"
14 #include "net/quic/core/quic_utils.h" 14 #include "net/quic/core/quic_utils.h"
15 #include "net/quic/platform/api/quic_str_cat.h"
15 #include "net/quic/test_tools/crypto_test_utils.h" 16 #include "net/quic/test_tools/crypto_test_utils.h"
16 #include "net/quic/test_tools/quic_crypto_server_config_peer.h" 17 #include "net/quic/test_tools/quic_crypto_server_config_peer.h"
17 #include "net/quic/test_tools/quic_test_utils.h" 18 #include "net/quic/test_tools/quic_test_utils.h"
18 19
19 using std::string; 20 using std::string;
20 21
21 namespace net { 22 namespace net {
22 namespace test { 23 namespace test {
23 namespace { 24 namespace {
24 25
(...skipping 19 matching lines...) Expand all
44 } 45 }
45 } 46 }
46 47
47 // Test various combinations of QUIC version and flag state. 48 // Test various combinations of QUIC version and flag state.
48 struct TestParams { 49 struct TestParams {
49 QuicVersion version; 50 QuicVersion version;
50 FlagsMode flags; 51 FlagsMode flags;
51 }; 52 };
52 53
53 string TestParamToString(const testing::TestParamInfo<TestParams>& params) { 54 string TestParamToString(const testing::TestParamInfo<TestParams>& params) {
54 return base::StringPrintf("v%i_%s", params.param.version, 55 return QuicStrCat("v", params.param.version, "_",
55 FlagsModeToString(params.param.flags)); 56 FlagsModeToString(params.param.flags));
56 } 57 }
57 58
58 std::vector<TestParams> GetTestParams() { 59 std::vector<TestParams> GetTestParams() {
59 std::vector<TestParams> params; 60 std::vector<TestParams> params;
60 for (FlagsMode flags : 61 for (FlagsMode flags :
61 {ENABLED, STATELESS_DISABLED, CHEAP_DISABLED, BOTH_DISABLED}) { 62 {ENABLED, STATELESS_DISABLED, CHEAP_DISABLED, BOTH_DISABLED}) {
62 for (QuicVersion version : AllSupportedVersions()) { 63 for (QuicVersion version : AllSupportedVersions()) {
63 TestParams param; 64 TestParams param;
64 param.version = version; 65 param.version = version;
65 param.flags = flags; 66 param.flags = flags;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 ASSERT_EQ(StatelessRejector::UNKNOWN, rejector_->state()); 283 ASSERT_EQ(StatelessRejector::UNKNOWN, rejector_->state());
283 StatelessRejector::Process(std::move(rejector_), 284 StatelessRejector::Process(std::move(rejector_),
284 base::MakeUnique<ProcessDoneCallback>(this)); 285 base::MakeUnique<ProcessDoneCallback>(this));
285 286
286 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_->state()); 287 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_->state());
287 } 288 }
288 289
289 } // namespace 290 } // namespace
290 } // namespace test 291 } // namespace test
291 } // namespace net 292 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_http_response_cache_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698