| 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 0ce77b23c67e1259e1ee5577a26d4dc4f0424c27..5d6f9e284dd4d261b0fc44b6043da58cd6bca74d 100644
|
| --- a/net/quic/core/quic_connection_test.cc
|
| +++ b/net/quic/core/quic_connection_test.cc
|
| @@ -3554,7 +3554,7 @@ TEST_P(QuicConnectionTest, TimeoutAfterReceiveNotSendWhenUnacked) {
|
| EXPECT_FALSE(connection_.GetTimeoutAlarm()->IsSet());
|
| }
|
|
|
| -TEST_P(QuicConnectionTest, TimeoutAfter5RTOs) {
|
| +TEST_P(QuicConnectionTest, TimeoutAfter5ClientRTOs) {
|
| connection_.SetMaxTailLossProbes(kDefaultPathId, 2);
|
| EXPECT_TRUE(connection_.connected());
|
| EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
|
| @@ -3587,6 +3587,42 @@ TEST_P(QuicConnectionTest, TimeoutAfter5RTOs) {
|
| EXPECT_FALSE(connection_.connected());
|
| }
|
|
|
| +TEST_P(QuicConnectionTest, TimeoutAfter5ServerRTOs) {
|
| + FLAGS_quic_only_5rto_client_side = true;
|
| + connection_.SetMaxTailLossProbes(kDefaultPathId, 2);
|
| + QuicConnectionPeer::SetPerspective(&connection_, Perspective::IS_SERVER);
|
| + QuicFramerPeer::SetPerspective(QuicConnectionPeer::GetFramer(&connection_),
|
| + Perspective::IS_SERVER);
|
| + creator_->StopSendingVersion();
|
| + EXPECT_TRUE(connection_.connected());
|
| + EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
|
| + QuicConfig config;
|
| + QuicTagVector connection_options;
|
| + connection_options.push_back(k5RTO);
|
| + config.SetConnectionOptionsToSend(connection_options);
|
| + connection_.SetFromConfig(config);
|
| +
|
| + // Send stream data.
|
| + SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, kFin, nullptr);
|
| +
|
| + EXPECT_CALL(visitor_, OnPathDegrading());
|
| + // Fire the retransmission alarm 6 times, twice for TLP and 4 times for RTO.
|
| + for (int i = 0; i < 6; ++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(4u, connection_.sent_packet_manager().GetConsecutiveRtoCount());
|
| + // The 5th RTO should not time out server side.
|
| + EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
|
| + connection_.GetRetransmissionAlarm()->Fire();
|
| + EXPECT_TRUE(connection_.GetTimeoutAlarm()->IsSet());
|
| + EXPECT_TRUE(connection_.connected());
|
| +}
|
| +
|
| TEST_P(QuicConnectionTest, SendScheduler) {
|
| // Test that if we send a packet without delay, it is not queued.
|
| QuicPacket* packet =
|
|
|