Prepare crypto stream tests for reordering versions
This CL paves the way for having TLS before QUIC_CRYPTO.
gfe-relnote: n/a, test-only
PiperOrigin-RevId: 298385523
Change-Id: I9e94e2d4662586b62c35cfd77ec68761eee50d61
diff --git a/quic/test_tools/crypto_test_utils.cc b/quic/test_tools/crypto_test_utils.cc
index 1379944..9537ec7 100644
--- a/quic/test_tools/crypto_test_utils.cc
+++ b/quic/test_tools/crypto_test_utils.cc
@@ -280,6 +280,15 @@
}
supported_versions.push_back(version);
}
+ CHECK(!options.only_quic_crypto_versions);
+ } else if (options.only_quic_crypto_versions) {
+ supported_versions.clear();
+ for (ParsedQuicVersion version : AllSupportedVersions()) {
+ if (version.handshake_protocol != PROTOCOL_QUIC_CRYPTO) {
+ continue;
+ }
+ supported_versions.push_back(version);
+ }
}
PacketSavingConnection* client_conn = new PacketSavingConnection(
helper, alarm_factory, Perspective::IS_CLIENT, supported_versions);
diff --git a/quic/test_tools/crypto_test_utils.h b/quic/test_tools/crypto_test_utils.h
index d80210a..3d58837 100644
--- a/quic/test_tools/crypto_test_utils.h
+++ b/quic/test_tools/crypto_test_utils.h
@@ -62,6 +62,10 @@
// If only_tls_versions is set, then the client will only use TLS for the
// crypto handshake.
bool only_tls_versions = false;
+
+ // If only_quic_crypto_versions is set, then the client will only use
+ // PROTOCOL_QUIC_CRYPTO for the crypto handshake.
+ bool only_quic_crypto_versions = false;
};
// Returns a QuicCryptoServerConfig that is in a reasonable configuration to