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

Unified Diff: net/quic/quic_stream_factory_test.cc

Issue 1775283002: [Domain Reliabiliy: net stack] Plumb received go away from server due to connection migration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove conditional assignment Created 4 years, 9 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
« no previous file with comments | « net/quic/quic_network_transaction_unittest.cc ('k') | net/quic/test_tools/quic_test_packet_maker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory_test.cc
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index 762a2d786d9b9588994623e7858cf72719da3acb..c01c3dc8701a2d90098068c74e7d4f72011604bb 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -603,6 +603,46 @@ TEST_P(QuicStreamFactoryTest, GoAway) {
EXPECT_TRUE(socket_data.AllWriteDataConsumed());
}
+TEST_P(QuicStreamFactoryTest, GoAwayForConnectionMigrationWithPortOnly) {
+ Initialize();
+ ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
+ crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
+
+ MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)};
+ SequencedSocketData socket_data(reads, arraysize(reads), nullptr, 0);
+ socket_factory_.AddSocketDataProvider(&socket_data);
+
+ QuicStreamRequest request(factory_.get());
+ EXPECT_EQ(ERR_IO_PENDING,
+ request.Request(host_port_pair_, privacy_mode_,
+ /*cert_verify_flags=*/0, url_, "GET", net_log_,
+ callback_.callback()));
+
+ EXPECT_EQ(OK, callback_.WaitForResult());
+ scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
+ EXPECT_TRUE(stream.get());
+
+ QuicChromiumClientSession* session =
+ QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
+
+ session->OnGoAway(
+ QuicGoAwayFrame(QUIC_ERROR_MIGRATING_PORT, 0,
+ "peer connection migration due to port change only"));
+ NetErrorDetails details;
+ EXPECT_FALSE(details.quic_port_migration_detected);
+ session->PopulateNetErrorDetails(&details);
+ EXPECT_TRUE(details.quic_port_migration_detected);
+ details.quic_port_migration_detected = false;
+ stream->PopulateNetErrorDetails(&details);
+ EXPECT_TRUE(details.quic_port_migration_detected);
+
+ EXPECT_FALSE(
+ QuicStreamFactoryPeer::HasActiveSession(factory_.get(), host_port_pair_));
+
+ EXPECT_TRUE(socket_data.AllReadDataConsumed());
+ EXPECT_TRUE(socket_data.AllWriteDataConsumed());
+}
+
TEST_P(QuicStreamFactoryTest, Pooling) {
Initialize();
ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
« no previous file with comments | « net/quic/quic_network_transaction_unittest.cc ('k') | net/quic/test_tools/quic_test_packet_maker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698