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

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

Issue 1411223011: Simplify QUIC stateless rejects by latching the value of FLAGS_enable_quic_stateless_reject_support… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106709176
Patch Set: Created 5 years, 1 month 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.cc ('k') | net/tools/quic/quic_server_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher_test.cc
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc
index 3f9b91b323ad7d28ffc94ef0a64fcdac9ae3a388..efe6acca0cd0b5393d1e8f1ecdf7c75c651233a3 100644
--- a/net/tools/quic/quic_dispatcher_test.cc
+++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -328,12 +328,9 @@ class MockQuicCryptoServerStream : public QuicCryptoServerStream {
struct StatelessRejectTestParams {
StatelessRejectTestParams(bool enable_stateless_rejects_via_flag,
- bool use_stateless_rejects_if_peer_supported,
bool client_supports_statelesss_rejects,
bool crypto_handshake_successful)
: enable_stateless_rejects_via_flag(enable_stateless_rejects_via_flag),
- use_stateless_rejects_if_peer_supported(
- use_stateless_rejects_if_peer_supported),
client_supports_statelesss_rejects(client_supports_statelesss_rejects),
crypto_handshake_successful(crypto_handshake_successful) {}
@@ -341,8 +338,6 @@ struct StatelessRejectTestParams {
const StatelessRejectTestParams& p) {
os << " enable_stateless_rejects_via_flag: "
<< p.enable_stateless_rejects_via_flag << std::endl;
- os << "{ use_stateless_rejects_if_peer_supported: "
- << p.use_stateless_rejects_if_peer_supported << std::endl;
os << "{ client_supports_statelesss_rejects: "
<< p.client_supports_statelesss_rejects << std::endl;
os << " crypto_handshake_successful: " << p.crypto_handshake_successful
@@ -351,12 +346,8 @@ struct StatelessRejectTestParams {
}
// This only enables the stateless reject feature via the feature-flag.
- // It does not force the crypto server to emit stateless rejects.
+ // This should be a no-op if the peer does not support them.
bool enable_stateless_rejects_via_flag;
- // If true, this forces the server to send a stateless reject when rejecting
- // messages. This should be a no-op if enable_stateless_rejects_via_flag is
- // false or the peer does not support them.
- bool use_stateless_rejects_if_peer_supported;
// Whether or not the client supports stateless rejects.
bool client_supports_statelesss_rejects;
// Should the initial crypto handshake succeed or not.
@@ -367,14 +358,11 @@ struct StatelessRejectTestParams {
vector<StatelessRejectTestParams> GetStatelessRejectTestParams() {
vector<StatelessRejectTestParams> params;
for (bool enable_stateless_rejects_via_flag : {true, false}) {
- for (bool use_stateless_rejects_if_peer_supported : {true, false}) {
- for (bool client_supports_statelesss_rejects : {true, false}) {
- for (bool crypto_handshake_successful : {true, false}) {
- params.push_back(StatelessRejectTestParams(
- enable_stateless_rejects_via_flag,
- use_stateless_rejects_if_peer_supported,
- client_supports_statelesss_rejects, crypto_handshake_successful));
- }
+ for (bool client_supports_statelesss_rejects : {true, false}) {
+ for (bool crypto_handshake_successful : {true, false}) {
+ params.push_back(StatelessRejectTestParams(
+ enable_stateless_rejects_via_flag,
+ client_supports_statelesss_rejects, crypto_handshake_successful));
}
}
}
@@ -404,7 +392,6 @@ class QuicDispatcherStatelessRejectTest
// a stateless reject, depending upon the parameters of the test.
bool ExpectStatelessReject() {
return GetParam().enable_stateless_rejects_via_flag &&
- GetParam().use_stateless_rejects_if_peer_supported &&
!GetParam().crypto_handshake_successful &&
GetParam().client_supports_statelesss_rejects;
}
@@ -419,8 +406,6 @@ class QuicDispatcherStatelessRejectTest
crypto_stream1_ = new MockQuicCryptoServerStream(crypto_config_, session1_);
session1_->SetCryptoStream(crypto_stream1_);
- crypto_stream1_->set_use_stateless_rejects_if_peer_supported(
- GetParam().use_stateless_rejects_if_peer_supported);
crypto_stream1_->set_handshake_confirmed_for_testing(
GetParam().crypto_handshake_successful);
crypto_stream1_->set_peer_supports_stateless_rejects(
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_server_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698