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/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 const char* FlagsModeToString(FlagsMode mode) { | 32 const char* FlagsModeToString(FlagsMode mode) { |
33 switch (mode) { | 33 switch (mode) { |
34 case ENABLED: | 34 case ENABLED: |
35 return "ENABLED"; | 35 return "ENABLED"; |
36 case STATELESS_DISABLED: | 36 case STATELESS_DISABLED: |
37 return "STATELESS_DISABLED"; | 37 return "STATELESS_DISABLED"; |
38 case CHEAP_DISABLED: | 38 case CHEAP_DISABLED: |
39 return "CHEAP_DISABLED"; | 39 return "CHEAP_DISABLED"; |
40 case BOTH_DISABLED: | 40 case BOTH_DISABLED: |
41 return "BOTH_DISABLED"; | 41 return "BOTH_DISABLED"; |
| 42 default: |
| 43 DLOG(FATAL) << "Unexpected FlagsMode"; |
| 44 return nullptr; |
42 } | 45 } |
43 } | 46 } |
44 | 47 |
45 // Test various combinations of QUIC version and flag state. | 48 // Test various combinations of QUIC version and flag state. |
46 struct TestParams { | 49 struct TestParams { |
47 QuicVersion version; | 50 QuicVersion version; |
48 FlagsMode flags; | 51 FlagsMode flags; |
49 }; | 52 }; |
50 | 53 |
51 string TestParamToString(const testing::TestParamInfo<TestParams>& params) { | 54 string TestParamToString(const testing::TestParamInfo<TestParams>& params) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 if (GetParam().flags != ENABLED || GetParam().version <= QUIC_VERSION_32) { | 253 if (GetParam().flags != ENABLED || GetParam().version <= QUIC_VERSION_32) { |
251 EXPECT_EQ(StatelessRejector::UNSUPPORTED, rejector_.state()); | 254 EXPECT_EQ(StatelessRejector::UNSUPPORTED, rejector_.state()); |
252 return; | 255 return; |
253 } | 256 } |
254 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_.state()); | 257 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_.state()); |
255 } | 258 } |
256 | 259 |
257 } // namespace | 260 } // namespace |
258 } // namespace test | 261 } // namespace test |
259 } // namespace net | 262 } // namespace net |
OLD | NEW |