| OLD | NEW |
| 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" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Test various combinations of QUIC version and flag state. | 47 // Test various combinations of QUIC version and flag state. |
| 48 struct TestParams { | 48 struct TestParams { |
| 49 QuicVersion version; | 49 QuicVersion version; |
| 50 FlagsMode flags; | 50 FlagsMode flags; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 string TestParamToString(const testing::TestParamInfo<TestParams>& params) { | 53 string TestParamToString(const testing::TestParamInfo<TestParams>& params) { |
| 54 return base::StringPrintf("v%i_%s", params.param.version, | 54 return QuicStrCat("v", params.param.version, "_", |
| 55 FlagsModeToString(params.param.flags)); | 55 FlagsModeToString(params.param.flags)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 std::vector<TestParams> GetTestParams() { | 58 std::vector<TestParams> GetTestParams() { |
| 59 std::vector<TestParams> params; | 59 std::vector<TestParams> params; |
| 60 for (FlagsMode flags : | 60 for (FlagsMode flags : |
| 61 {ENABLED, STATELESS_DISABLED, CHEAP_DISABLED, BOTH_DISABLED}) { | 61 {ENABLED, STATELESS_DISABLED, CHEAP_DISABLED, BOTH_DISABLED}) { |
| 62 for (QuicVersion version : AllSupportedVersions()) { | 62 for (QuicVersion version : AllSupportedVersions()) { |
| 63 TestParams param; | 63 TestParams param; |
| 64 param.version = version; | 64 param.version = version; |
| 65 param.flags = flags; | 65 param.flags = flags; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 ASSERT_EQ(StatelessRejector::UNKNOWN, rejector_->state()); | 282 ASSERT_EQ(StatelessRejector::UNKNOWN, rejector_->state()); |
| 283 StatelessRejector::Process(std::move(rejector_), | 283 StatelessRejector::Process(std::move(rejector_), |
| 284 base::MakeUnique<ProcessDoneCallback>(this)); | 284 base::MakeUnique<ProcessDoneCallback>(this)); |
| 285 | 285 |
| 286 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_->state()); | 286 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_->state()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace | 289 } // namespace |
| 290 } // namespace test | 290 } // namespace test |
| 291 } // namespace net | 291 } // namespace net |
| OLD | NEW |