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

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

Issue 2678973002: Replace va_arg version of crypto_test_utils::Message with a more modern vector argument version. (Closed)
Patch Set: Created 3 years, 10 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_dispatcher_test.cc ('k') | no next file » | 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 fdc883ef337ad86c567be97c2ecd153c3852e661..0076c13d7aa64ff79f4854b86e6f8e165c7f4e80 100644
--- a/net/tools/quic/stateless_rejector_test.cc
+++ b/net/tools/quic/stateless_rejector_test.cc
@@ -170,11 +170,9 @@ INSTANTIATE_TEST_CASE_P(Flags,
TEST_P(StatelessRejectorTest, InvalidChlo) {
// clang-format off
- const CryptoHandshakeMessage client_hello = crypto_test_utils::Message(
- "CHLO",
- "PDMD", "X509",
- "COPT", "SREJ",
- nullptr);
+ const CryptoHandshakeMessage client_hello = crypto_test_utils::CreateCHLO(
+ {{"PDMD", "X509"},
+ {"COPT", "SREJ"}});
// clang-format on
rejector_->OnChlo(GetParam().version, kConnectionId,
kServerDesignateConnectionId, client_hello);
@@ -195,16 +193,14 @@ TEST_P(StatelessRejectorTest, InvalidChlo) {
TEST_P(StatelessRejectorTest, ValidChloWithoutSrejSupport) {
// clang-format off
- const CryptoHandshakeMessage client_hello = crypto_test_utils::Message(
- "CHLO",
- "PDMD", "X509",
- "AEAD", "AESG",
- "KEXS", "C255",
- "PUBS", pubs_hex_.c_str(),
- "NONC", nonc_hex_.c_str(),
- "VER\0", ver_hex_.c_str(),
- "$padding", static_cast<int>(kClientHelloMinimumSize),
- nullptr);
+ const CryptoHandshakeMessage client_hello = crypto_test_utils::CreateCHLO(
+ {{"PDMD", "X509"},
+ {"AEAD", "AESG"},
+ {"KEXS", "C255"},
+ {"PUBS", pubs_hex_},
+ {"NONC", nonc_hex_},
+ {"VER\0", ver_hex_}},
+ kClientHelloMinimumSize);
// clang-format on
rejector_->OnChlo(GetParam().version, kConnectionId,
@@ -214,19 +210,17 @@ TEST_P(StatelessRejectorTest, ValidChloWithoutSrejSupport) {
TEST_P(StatelessRejectorTest, RejectChlo) {
// clang-format off
- const CryptoHandshakeMessage client_hello = crypto_test_utils::Message(
- "CHLO",
- "PDMD", "X509",
- "AEAD", "AESG",
- "KEXS", "C255",
- "COPT", "SREJ",
- "SCID", scid_hex_.c_str(),
- "PUBS", pubs_hex_.c_str(),
- "NONC", nonc_hex_.c_str(),
- "#004b5453", stk_hex_.c_str(),
- "VER\0", ver_hex_.c_str(),
- "$padding", static_cast<int>(kClientHelloMinimumSize),
- nullptr);
+ const CryptoHandshakeMessage client_hello = crypto_test_utils::CreateCHLO(
+ {{"PDMD", "X509"},
+ {"AEAD", "AESG"},
+ {"KEXS", "C255"},
+ {"COPT", "SREJ"},
+ {"SCID", scid_hex_},
+ {"PUBS", pubs_hex_},
+ {"NONC", nonc_hex_},
+ {"#004b5453", stk_hex_},
+ {"VER\0", ver_hex_}},
+ kClientHelloMinimumSize);
// clang-format on
rejector_->OnChlo(GetParam().version, kConnectionId,
@@ -259,20 +253,18 @@ TEST_P(StatelessRejectorTest, AcceptChlo) {
"#" + QuicTextUtils::HexEncode(reinterpret_cast<const char*>(&xlct),
sizeof(xlct));
// clang-format off
- const CryptoHandshakeMessage client_hello = crypto_test_utils::Message(
- "CHLO",
- "PDMD", "X509",
- "AEAD", "AESG",
- "KEXS", "C255",
- "COPT", "SREJ",
- "SCID", scid_hex_.c_str(),
- "PUBS", pubs_hex_.c_str(),
- "NONC", nonc_hex_.c_str(),
- "#004b5453", stk_hex_.c_str(),
- "VER\0", ver_hex_.c_str(),
- "XLCT", xlct_hex.c_str(),
- "$padding", static_cast<int>(kClientHelloMinimumSize),
- nullptr);
+ const CryptoHandshakeMessage client_hello = crypto_test_utils::CreateCHLO(
+ {{"PDMD", "X509"},
+ {"AEAD", "AESG"},
+ {"KEXS", "C255"},
+ {"COPT", "SREJ"},
+ {"SCID", scid_hex_},
+ {"PUBS", pubs_hex_},
+ {"NONC", nonc_hex_},
+ {"#004b5453", stk_hex_},
+ {"VER\0", ver_hex_},
+ {"XLCT", xlct_hex}},
+ kClientHelloMinimumSize);
// clang-format on
rejector_->OnChlo(GetParam().version, kConnectionId,
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698