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()); |