| Index: net/quic/core/quic_crypto_client_stream_test.cc
|
| diff --git a/net/quic/core/quic_crypto_client_stream_test.cc b/net/quic/core/quic_crypto_client_stream_test.cc
|
| index b43884b9cfdc61143e7cf39f3acc3f7f83ac4d68..b839536d928604390a9f9cc2307c0f5faa16d368 100644
|
| --- a/net/quic/core/quic_crypto_client_stream_test.cc
|
| +++ b/net/quic/core/quic_crypto_client_stream_test.cc
|
| @@ -234,6 +234,41 @@ TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdate) {
|
| QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer));
|
| }
|
|
|
| +TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdateWithCert) {
|
| + // Test that the crypto client stream can receive and use server config
|
| + // updates with certificates after the connection has been established.
|
| + CompleteCryptoHandshake();
|
| +
|
| + // Build a server config update message with certificates
|
| + QuicCryptoServerConfig crypto_config(
|
| + QuicCryptoServerConfig::TESTING, QuicRandom::GetInstance(),
|
| + CryptoTestUtils::ProofSourceForTesting());
|
| + CryptoTestUtils::FakeServerOptions options;
|
| + CryptoTestUtils::SetupCryptoServerConfigForTest(
|
| + connection_->clock(), QuicRandom::GetInstance(), &crypto_config, options);
|
| + SourceAddressTokens tokens;
|
| + QuicCompressedCertsCache cache(1);
|
| + CachedNetworkParameters network_params;
|
| + CryptoHandshakeMessage server_config_update;
|
| + EXPECT_TRUE(crypto_config.BuildServerConfigUpdateMessage(
|
| + session_->connection()->version(), stream()->chlo_hash(), tokens,
|
| + QuicIpAddress::Loopback6(), QuicIpAddress::Loopback6(),
|
| + connection_->clock(), QuicRandom::GetInstance(), &cache,
|
| + stream()->crypto_negotiated_params(), &network_params, QuicTagVector(),
|
| + &server_config_update));
|
| +
|
| + std::unique_ptr<QuicData> data(
|
| + CryptoFramer::ConstructHandshakeMessage(server_config_update));
|
| + stream()->OnStreamFrame(QuicStreamFrame(kCryptoStreamId, /*fin=*/false,
|
| + /*offset=*/0, data->AsStringPiece()));
|
| +
|
| + // Recreate connection with the new config and verify a 0-RTT attempt.
|
| + CreateConnection();
|
| +
|
| + stream()->CryptoConnect();
|
| + EXPECT_TRUE(session_->IsEncryptionEstablished());
|
| +}
|
| +
|
| TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdateBeforeHandshake) {
|
| EXPECT_CALL(
|
| *connection_,
|
|
|