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

Unified Diff: net/quic/core/quic_crypto_client_stream_test.cc

Issue 2547583002: Landing Recent QUIC changes until Fri Nov 18 23:21:04 2016 +0000 (Closed)
Patch Set: Remove explicit HTTP/2 enum usage Created 4 years 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/quic/core/quic_crypto_client_stream.cc ('k') | net/quic/core/quic_crypto_server_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c81c6b7fcefae84ccea53c055ddcdaddcb3f6bf2..b839536d928604390a9f9cc2307c0f5faa16d368 100644
--- a/net/quic/core/quic_crypto_client_stream_test.cc
+++ b/net/quic/core/quic_crypto_client_stream_test.cc
@@ -10,7 +10,7 @@
#include "net/quic/core/crypto/quic_decrypter.h"
#include "net/quic/core/crypto/quic_encrypter.h"
#include "net/quic/core/quic_flags.h"
-#include "net/quic/core/quic_protocol.h"
+#include "net/quic/core/quic_packets.h"
#include "net/quic/core/quic_server_id.h"
#include "net/quic/core/quic_utils.h"
#include "net/quic/test_tools/crypto_test_utils.h"
@@ -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_,
« no previous file with comments | « net/quic/core/quic_crypto_client_stream.cc ('k') | net/quic/core/quic_crypto_server_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698