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

Unified Diff: net/quic/quic_stream_factory_test.cc

Issue 1768593003: When QUIC is disabled because of timeouts with open streams, re-enable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 10 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_stream_factory.cc ('k') | no next file » | 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 e5fcf955b2b9f03108d8571b273c41d0d7a9e434..0b7750684f1eae95279dfc186ddfe7b9feee4c65 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -2732,6 +2732,13 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfTwo) {
EXPECT_EQ(QuicChromiumClientSession::QUIC_DISABLED_TIMEOUT_WITH_OPEN_STREAMS,
factory_->QuicDisabledReason(host_port_pair_.port()));
+ // Verify that QUIC is un-disabled after a TCP job fails.
+ factory_->OnTcpJobCompleted(/*succeeded=*/false);
+ EXPECT_EQ(
+ 0, QuicStreamFactoryPeer::GetNumTimeoutsWithOpenStreams(factory_.get()));
+ EXPECT_FALSE(QuicStreamFactoryPeer::IsQuicDisabled(factory_.get(),
+ host_port_pair_.port()));
+
EXPECT_TRUE(socket_data.AllReadDataConsumed());
EXPECT_TRUE(socket_data.AllWriteDataConsumed());
EXPECT_TRUE(socket_data2.AllReadDataConsumed());
@@ -2971,6 +2978,14 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfThree) {
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
+
+ // Verify that QUIC is un-disabled after a network change.
+ factory_->OnIPAddressChanged();
+ EXPECT_FALSE(QuicStreamFactoryPeer::IsQuicDisabled(factory_.get(),
+ host_port_pair_.port()));
+ EXPECT_EQ(
+ 0, QuicStreamFactoryPeer::GetNumTimeoutsWithOpenStreams(factory_.get()));
+
EXPECT_TRUE(socket_data.AllReadDataConsumed());
EXPECT_TRUE(socket_data.AllWriteDataConsumed());
EXPECT_TRUE(socket_data2.AllReadDataConsumed());
@@ -3035,6 +3050,16 @@ TEST_P(QuicStreamFactoryTest, DisableQuicWhenTimeoutsWithOpenStreams) {
EXPECT_EQ(QuicChromiumClientSession::QUIC_DISABLED_TIMEOUT_WITH_OPEN_STREAMS,
factory_->QuicDisabledReason(host_port_pair_.port()));
+ // Verify that QUIC is fully disabled after a TCP job succeeds.
+ factory_->OnTcpJobCompleted(/*succeeded=*/true);
+ EXPECT_TRUE(QuicStreamFactoryPeer::IsQuicDisabled(factory_.get(),
+ host_port_pair_.port()));
+
+ // Verify that QUIC stays disabled after a TCP job succeeds.
+ factory_->OnTcpJobCompleted(/*succeeded=*/false);
+ EXPECT_TRUE(QuicStreamFactoryPeer::IsQuicDisabled(factory_.get(),
+ host_port_pair_.port()));
+
EXPECT_TRUE(socket_data.AllReadDataConsumed());
EXPECT_TRUE(socket_data.AllWriteDataConsumed());
}
@@ -3323,6 +3348,7 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfFour) {
EXPECT_TRUE(stream2.get());
scoped_ptr<QuicHttpStream> stream3 = request3.ReleaseStream();
EXPECT_TRUE(stream3.get());
+
EXPECT_TRUE(socket_data.AllReadDataConsumed());
EXPECT_TRUE(socket_data.AllWriteDataConsumed());
EXPECT_TRUE(socket_data2.AllReadDataConsumed());
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698