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

Unified Diff: net/tools/quic/stateless_rejector_test.cc

Issue 2308043003: Landing Recent QUIC changes until 5:55 PM, Aug 25, 2016 UTC-4 (Closed)
Patch Set: Fixes for various tests Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_server_test.cc ('k') | net/tools/quic/test_tools/quic_dispatcher_peer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/stateless_rejector_test.cc
diff --git a/net/tools/quic/stateless_rejector_test.cc b/net/tools/quic/stateless_rejector_test.cc
index 0a939530510df8c502984825c3a8b4681b65b3fb..1b1f3cb0fa92be34756dc7a41e3ad950ef26c05c 100644
--- a/net/tools/quic/stateless_rejector_test.cc
+++ b/net/tools/quic/stateless_rejector_test.cc
@@ -7,6 +7,7 @@
#include <memory>
#include <vector>
+#include "base/strings/stringprintf.h"
#include "net/quic/core/crypto/crypto_handshake_message.h"
#include "net/quic/core/crypto/proof_source.h"
#include "net/quic/core/quic_utils.h"
@@ -28,16 +29,30 @@ const QuicConnectionId kServerDesignateConnectionId = 24;
// All four combinations of the two flags involved.
enum FlagsMode { ENABLED, STATELESS_DISABLED, CHEAP_DISABLED, BOTH_DISABLED };
+const char* FlagsModeToString(FlagsMode mode) {
+ switch (mode) {
+ case ENABLED:
+ return "ENABLED";
+ case STATELESS_DISABLED:
+ return "STATELESS_DISABLED";
+ case CHEAP_DISABLED:
+ return "CHEAP_DISABLED";
+ case BOTH_DISABLED:
+ return "BOTH_DISABLED";
+ }
+}
+
// Test various combinations of QUIC version and flag state.
struct TestParams {
QuicVersion version;
FlagsMode flags;
- friend ostream& operator<<(ostream& os, const TestParams& p) {
- os << "{ version: " << p.version << " flags: " << p.flags << " }";
- return os;
- }
};
+string TestParamToString(const testing::TestParamInfo<TestParams>& params) {
+ return base::StringPrintf("v%i_%s", params.param.version,
+ FlagsModeToString(params.param.flags));
+}
+
vector<TestParams> GetTestParams() {
vector<TestParams> params;
for (FlagsMode flags :
@@ -131,7 +146,8 @@ class StatelessRejectorTest : public ::testing::TestWithParam<TestParams> {
INSTANTIATE_TEST_CASE_P(Flags,
StatelessRejectorTest,
- ::testing::ValuesIn(GetTestParams()));
+ ::testing::ValuesIn(GetTestParams()),
+ TestParamToString);
TEST_P(StatelessRejectorTest, InvalidChlo) {
// clang-format off
« no previous file with comments | « net/tools/quic/quic_server_test.cc ('k') | net/tools/quic/test_tools/quic_dispatcher_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698