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

Unified Diff: net/quic/crypto/crypto_server_test.cc

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
Index: net/quic/crypto/crypto_server_test.cc
diff --git a/net/quic/crypto/crypto_server_test.cc b/net/quic/crypto/crypto_server_test.cc
index 7ff7e9ec7fbd619e19f26a95f386577a15d6768a..bd788502a457440deb225037e8d97d551836305c 100644
--- a/net/quic/crypto/crypto_server_test.cc
+++ b/net/quic/crypto/crypto_server_test.cc
@@ -42,36 +42,27 @@ class QuicCryptoServerConfigPeer {
QuicCryptoServerConfig* server_config_;
};
-// Run tests with combinations of
-// {FLAGS_use_early_return_when_verifying_chlo,
-// FLAGS_send_quic_crypto_reject_reason}.
+// Run tests with both parities of
+// FLAGS_use_early_return_when_verifying_chlo.
struct TestParams {
- TestParams(bool use_early_return_when_verifying_chlo,
- bool send_quic_crypto_reject_reason)
+ explicit TestParams(bool use_early_return_when_verifying_chlo)
: use_early_return_when_verifying_chlo(
- use_early_return_when_verifying_chlo),
- send_quic_crypto_reject_reason(send_quic_crypto_reject_reason) {
- }
+ use_early_return_when_verifying_chlo) {}
friend ostream& operator<<(ostream& os, const TestParams& p) {
os << "{ use_early_return_when_verifying_chlo: "
- << p.use_early_return_when_verifying_chlo
- << " send_quic_crypto_reject_reason: "
- << p.send_quic_crypto_reject_reason << " }";
+ << p.use_early_return_when_verifying_chlo << " }";
return os;
}
bool use_early_return_when_verifying_chlo;
- bool send_quic_crypto_reject_reason;
};
// Constructs various test permutations.
vector<TestParams> GetTestParams() {
vector<TestParams> params;
- params.push_back(TestParams(false, false));
- params.push_back(TestParams(false, true));
- params.push_back(TestParams(true, false));
- params.push_back(TestParams(true, true));
+ params.push_back(TestParams(false));
+ params.push_back(TestParams(true));
return params;
}
@@ -88,8 +79,6 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
FLAGS_use_early_return_when_verifying_chlo =
GetParam().use_early_return_when_verifying_chlo;
- FLAGS_send_quic_crypto_reject_reason =
- GetParam().send_quic_crypto_reject_reason;
}
void SetUp() override {
@@ -273,13 +262,9 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
size_t expected_count) {
const uint32* reject_reasons;
size_t num_reject_reasons;
- COMPILE_ASSERT(sizeof(QuicTag) == sizeof(uint32), header_out_of_sync);
+ static_assert(sizeof(QuicTag) == sizeof(uint32), "header out of sync");
QuicErrorCode error_code = out_.GetTaglist(kRREJ, &reject_reasons,
&num_reject_reasons);
- if (!FLAGS_send_quic_crypto_reject_reason) {
- ASSERT_EQ(QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND, error_code);
- return;
- }
ASSERT_EQ(QUIC_NO_ERROR, error_code);
if (FLAGS_use_early_return_when_verifying_chlo) {
@@ -310,9 +295,8 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
scoped_ptr<CryptoHandshakeMessage> server_config_;
};
-// Run all CryptoServerTest with all combinations of
-// FLAGS_use_early_return_when_verifying_chlo and
-// FLAGS_send_quic_crypto_reject_reason.
+// Run all CryptoServerTest with both values of
+// FLAGS_use_early_return_when_verifying_chlo
INSTANTIATE_TEST_CASE_P(CryptoServerTests,
CryptoServerTest,
::testing::ValuesIn(GetTestParams()));

Powered by Google App Engine
This is Rietveld 408576698