| Index: net/quic/quic_connection_test.cc
|
| diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
|
| index 0a184eddac162b93061dcf23fd35139f4dac4492..38ec1aa54bf1445cf91da8df7911594828927ec8 100644
|
| --- a/net/quic/quic_connection_test.cc
|
| +++ b/net/quic/quic_connection_test.cc
|
| @@ -435,9 +435,6 @@ class TestConnection : public QuicConnection {
|
| /* owns_writer= */ false,
|
| perspective,
|
| SupportedVersions(version)) {
|
| - // Disable tail loss probes for most tests.
|
| - QuicSentPacketManagerPeer::SetMaxTailLossProbes(
|
| - QuicConnectionPeer::GetSentPacketManager(this), 0);
|
| writer->set_perspective(perspective);
|
| }
|
|
|
| @@ -580,6 +577,11 @@ class TestConnection : public QuicConnection {
|
| QuicConnectionPeer::GetMtuDiscoveryAlarm(this));
|
| }
|
|
|
| + void DisableTailLossProbe() {
|
| + QuicSentPacketManagerPeer::SetMaxTailLossProbes(
|
| + QuicConnectionPeer::GetSentPacketManager(this), 0);
|
| + }
|
| +
|
| using QuicConnection::SelectMutualVersion;
|
| using QuicConnection::set_defer_send_in_response_to_packets;
|
|
|
| @@ -2044,6 +2046,8 @@ TEST_P(QuicConnectionTest, DoNotRetransmitForResetStreamOnRTO) {
|
| }
|
|
|
| TEST_P(QuicConnectionTest, RetransmitForQuicRstStreamNoErrorOnRTO) {
|
| + connection_.DisableTailLossProbe();
|
| +
|
| QuicStreamId stream_id = 2;
|
| QuicPacketNumber last_packet;
|
| SendStreamDataToPeer(stream_id, "foo", 0, !kFin, &last_packet);
|
| @@ -2062,7 +2066,7 @@ TEST_P(QuicConnectionTest, RetransmitForQuicRstStreamNoErrorOnRTO) {
|
| clock_.AdvanceTime(DefaultRetransmissionTime());
|
| connection_.GetRetransmissionAlarm()->Fire();
|
| EXPECT_EQ(1u, writer_->frame_count());
|
| - EXPECT_EQ(1u, writer_->rst_stream_frames().size());
|
| + ASSERT_EQ(1u, writer_->rst_stream_frames().size());
|
| EXPECT_EQ(stream_id, writer_->rst_stream_frames().front().stream_id);
|
| }
|
|
|
| @@ -2201,6 +2205,8 @@ TEST_P(QuicConnectionTest, RetransmitNackedLargestObserved) {
|
| }
|
|
|
| TEST_P(QuicConnectionTest, QueueAfterTwoRTOs) {
|
| + connection_.DisableTailLossProbe();
|
| +
|
| for (int i = 0; i < 10; ++i) {
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1);
|
| connection_.SendStreamDataWithString(3, "foo", i * 3, !kFin, nullptr);
|
| @@ -2434,6 +2440,8 @@ TEST_P(QuicConnectionTest, TLP) {
|
| }
|
|
|
| TEST_P(QuicConnectionTest, RTO) {
|
| + connection_.DisableTailLossProbe();
|
| +
|
| QuicTime default_retransmission_time =
|
| clock_.ApproximateNow().Add(DefaultRetransmissionTime());
|
| SendStreamDataToPeer(3, "foo", 0, !kFin, nullptr);
|
| @@ -2452,6 +2460,8 @@ TEST_P(QuicConnectionTest, RTO) {
|
| }
|
|
|
| TEST_P(QuicConnectionTest, RTOWithSameEncryptionLevel) {
|
| + connection_.DisableTailLossProbe();
|
| +
|
| QuicTime default_retransmission_time =
|
| clock_.ApproximateNow().Add(DefaultRetransmissionTime());
|
| use_tagging_decrypter();
|
| @@ -2676,6 +2686,8 @@ TEST_P(QuicConnectionTest, Buffer100NonDecryptablePackets) {
|
| }
|
|
|
| TEST_P(QuicConnectionTest, TestRetransmitOrder) {
|
| + connection_.DisableTailLossProbe();
|
| +
|
| QuicByteCount first_packet_size;
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
|
| .WillOnce(DoAll(SaveArg<3>(&first_packet_size), Return(true)));
|
| @@ -2719,6 +2731,8 @@ TEST_P(QuicConnectionTest, SetRTOAfterWritingToSocket) {
|
| }
|
|
|
| TEST_P(QuicConnectionTest, DelayRTOWithAckReceipt) {
|
| + connection_.DisableTailLossProbe();
|
| +
|
| EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
|
| connection_.SendStreamDataWithString(2, "foo", 0, !kFin, nullptr);
|
| @@ -2757,6 +2771,8 @@ TEST_P(QuicConnectionTest, DelayRTOWithAckReceipt) {
|
| }
|
|
|
| TEST_P(QuicConnectionTest, TestQueued) {
|
| + connection_.DisableTailLossProbe();
|
| +
|
| EXPECT_EQ(0u, connection_.NumQueuedPackets());
|
| BlockOnNextWrite();
|
| connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
|
| @@ -4191,6 +4207,8 @@ TEST_P(QuicConnectionTest, BadVersionNegotiation) {
|
| }
|
|
|
| TEST_P(QuicConnectionTest, CheckSendStats) {
|
| + connection_.DisableTailLossProbe();
|
| +
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
|
| connection_.SendStreamDataWithString(3, "first", 0, !kFin, nullptr);
|
| size_t first_packet_size = writer_->last_packet_size();
|
| @@ -4403,6 +4421,8 @@ TEST_P(QuicConnectionTest, AckNotifierCallbackAfterRetransmission) {
|
| // out and was retransmitted, even though the retransmission has a
|
| // different packet number.
|
| TEST_P(QuicConnectionTest, AckNotifierCallbackForAckAfterRTO) {
|
| + connection_.DisableTailLossProbe();
|
| +
|
| // Create a listener which we expect to be called.
|
| scoped_refptr<MockAckListener> listener(new StrictMock<MockAckListener>);
|
|
|
| @@ -4651,7 +4671,11 @@ TEST_P(QuicConnectionTest, OnPathDegrading) {
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
|
| .WillOnce(DoAll(SaveArg<3>(&packet_size), Return(true)));
|
| connection_.SendStreamDataWithString(3, "packet", 0, !kFin, nullptr);
|
| - for (size_t i = 1; i < kMinTimeoutsBeforePathDegrading; ++i) {
|
| + size_t num_timeouts =
|
| + kMinTimeoutsBeforePathDegrading +
|
| + QuicSentPacketManagerPeer::GetMaxTailLossProbes(
|
| + QuicConnectionPeer::GetSentPacketManager(&connection_));
|
| + for (size_t i = 1; i < num_timeouts; ++i) {
|
| clock_.AdvanceTime(QuicTime::Delta::FromSeconds(10 * i));
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, packet_size, _));
|
| connection_.GetRetransmissionAlarm()->Fire();
|
|
|