| Index: net/quic/core/quic_connection_test.cc
|
| diff --git a/net/quic/core/quic_connection_test.cc b/net/quic/core/quic_connection_test.cc
|
| index f6df716f18223318588c385de54a5cb0bffff2af..3075a0a5b7cba2a267d973f9040efd0fee426ee1 100644
|
| --- a/net/quic/core/quic_connection_test.cc
|
| +++ b/net/quic/core/quic_connection_test.cc
|
| @@ -3617,6 +3617,40 @@ TEST_P(QuicConnectionTest, TimeoutAfter5ClientRTOs) {
|
| EXPECT_FALSE(connection_.connected());
|
| }
|
|
|
| +TEST_P(QuicConnectionTest, TimeoutAfter3ClientRTOs) {
|
| + FLAGS_quic_reloadable_flag_quic_enable_3rtos = true;
|
| + connection_.SetMaxTailLossProbes(2);
|
| + EXPECT_TRUE(connection_.connected());
|
| + EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
|
| + QuicConfig config;
|
| + QuicTagVector connection_options;
|
| + connection_options.push_back(k3RTO);
|
| + config.SetConnectionOptionsToSend(connection_options);
|
| + connection_.SetFromConfig(config);
|
| +
|
| + // Send stream data.
|
| + SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, FIN, nullptr);
|
| +
|
| + EXPECT_CALL(visitor_, OnPathDegrading());
|
| + // Fire the retransmission alarm 4 times, twice for TLP and 2 times for RTO.
|
| + for (int i = 0; i < 4; ++i) {
|
| + EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
|
| + connection_.GetRetransmissionAlarm()->Fire();
|
| + EXPECT_TRUE(connection_.GetTimeoutAlarm()->IsSet());
|
| + EXPECT_TRUE(connection_.connected());
|
| + }
|
| +
|
| + EXPECT_EQ(2u, connection_.sent_packet_manager().GetConsecutiveTlpCount());
|
| + EXPECT_EQ(2u, connection_.sent_packet_manager().GetConsecutiveRtoCount());
|
| + // This time, we should time out.
|
| + EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_TOO_MANY_RTOS, _,
|
| + ConnectionCloseSource::FROM_SELF));
|
| + EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
|
| + connection_.GetRetransmissionAlarm()->Fire();
|
| + EXPECT_FALSE(connection_.GetTimeoutAlarm()->IsSet());
|
| + EXPECT_FALSE(connection_.connected());
|
| +}
|
| +
|
| TEST_P(QuicConnectionTest, SendScheduler) {
|
| // Test that if we send a packet without delay, it is not queued.
|
| QuicPacket* packet = ConstructDataPacket(1, !kHasStopWaiting);
|
|
|