Index: net/quic/quic_sent_packet_manager_test.cc |
diff --git a/net/quic/quic_sent_packet_manager_test.cc b/net/quic/quic_sent_packet_manager_test.cc |
index 99ed47918b41add7fcfef03606f555e047ab63c4..275b2106b2f8a33f5dd83be669bb350ab084c136 100644 |
--- a/net/quic/quic_sent_packet_manager_test.cc |
+++ b/net/quic/quic_sent_packet_manager_test.cc |
@@ -44,7 +44,7 @@ class MockDebugDelegate : public QuicSentPacketManager::DebugDelegate { |
class QuicSentPacketManagerTest : public ::testing::TestWithParam<bool> { |
protected: |
QuicSentPacketManagerTest() |
- : manager_(true, &clock_, &stats_, kFixRateCongestionControl, kNack), |
+ : manager_(true, &clock_, &stats_, kCubic, kNack), |
send_algorithm_(new StrictMock<MockSendAlgorithm>), |
network_change_visitor_(new StrictMock<MockNetworkChangeVisitor>) { |
QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_); |
@@ -301,11 +301,11 @@ TEST_F(QuicSentPacketManagerTest, RetransmitThenAck) { |
RetransmitAndSendPacket(1, 2); |
// Ack 2 but not 1. |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 2; |
- received_info.missing_packets.insert(1); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 2; |
+ ack_frame.missing_packets.insert(1); |
ExpectAck(2); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
// Packet 1 is unacked, pending, but not retransmittable. |
QuicPacketSequenceNumber unacked[] = { 1 }; |
@@ -321,10 +321,10 @@ TEST_F(QuicSentPacketManagerTest, RetransmitThenAckBeforeSend) { |
EXPECT_TRUE(manager_.HasPendingRetransmissions()); |
// Ack 1. |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 1; |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 1; |
ExpectAck(1); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
// There should no longer be a pending retransmission. |
EXPECT_FALSE(manager_.HasPendingRetransmissions()); |
@@ -343,9 +343,9 @@ TEST_F(QuicSentPacketManagerTest, RetransmitThenAckPrevious) { |
// Ack 1 but not 2. |
ExpectAck(1); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 1; |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 1; |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
// 2 should be unacked, since it may provide an RTT measurement. |
QuicPacketSequenceNumber unacked[] = { 2 }; |
@@ -367,9 +367,9 @@ TEST_F(QuicSentPacketManagerTest, RetransmitAndSendThenAckPrevious) { |
// Ack 1 but not 2. |
ExpectAck(1); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 1; |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 1; |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
// 2 remains unacked, but no packets have retransmittable data. |
QuicPacketSequenceNumber unacked[] = { 2 }; |
@@ -392,9 +392,9 @@ TEST_F(QuicSentPacketManagerTest, RetransmitThenAckPreviousThenNackRetransmit) { |
// First, ACK packet 1 which makes packet 2 non-retransmittable. |
ExpectAck(1); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 1; |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 1; |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
SendDataPacket(3); |
SendDataPacket(4); |
@@ -402,18 +402,18 @@ TEST_F(QuicSentPacketManagerTest, RetransmitThenAckPreviousThenNackRetransmit) { |
clock_.AdvanceTime(rtt); |
// Next, NACK packet 2 three times. |
- received_info.largest_observed = 3; |
- received_info.missing_packets.insert(2); |
+ ack_frame.largest_observed = 3; |
+ ack_frame.missing_packets.insert(2); |
ExpectAck(3); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
- received_info.largest_observed = 4; |
+ ack_frame.largest_observed = 4; |
ExpectAck(4); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
- received_info.largest_observed = 5; |
+ ack_frame.largest_observed = 5; |
ExpectAckAndLoss(true, 5, 2); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
// No packets remain unacked. |
VerifyUnackedPackets(NULL, 0); |
@@ -440,11 +440,11 @@ TEST_F(QuicSentPacketManagerTest, RetransmitTwiceThenAckPreviousBeforeSend) { |
// Ack 1 but not 2, before 2 is able to be sent. |
// Since 1 has been retransmitted, it has already been lost, and so the |
// send algorithm is not informed that it has been ACK'd. |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 1; |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 1; |
ExpectUpdatedRtt(1); |
EXPECT_CALL(*send_algorithm_, RevertRetransmissionTimeout()); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
// Since 2 was marked for retransmit, when 1 is acked, 2 is kept for RTT. |
QuicPacketSequenceNumber unacked[] = { 2 }; |
@@ -471,9 +471,9 @@ TEST_F(QuicSentPacketManagerTest, RetransmitTwiceThenAckFirst) { |
// Ack 1 but not 2 or 3. |
ExpectAck(1); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 1; |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 1; |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
// 2 and 3 remain unacked, but no packets have retransmittable data. |
QuicPacketSequenceNumber unacked[] = { 2, 3 }; |
@@ -483,20 +483,20 @@ TEST_F(QuicSentPacketManagerTest, RetransmitTwiceThenAckFirst) { |
// Ensure packet 2 is lost when 4 is sent and 3 and 4 are acked. |
SendDataPacket(4); |
- received_info.largest_observed = 4; |
- received_info.missing_packets.insert(2); |
+ ack_frame.largest_observed = 4; |
+ ack_frame.missing_packets.insert(2); |
QuicPacketSequenceNumber acked[] = { 3, 4 }; |
ExpectAcksAndLosses(true, acked, arraysize(acked), NULL, 0); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
QuicPacketSequenceNumber unacked2[] = { 2 }; |
VerifyUnackedPackets(unacked2, arraysize(unacked2)); |
EXPECT_TRUE(QuicSentPacketManagerPeer::HasPendingPackets(&manager_)); |
SendDataPacket(5); |
- received_info.largest_observed = 5; |
+ ack_frame.largest_observed = 5; |
ExpectAckAndLoss(true, 5, 2); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
VerifyUnackedPackets(NULL, 0); |
EXPECT_FALSE(QuicSentPacketManagerPeer::HasPendingPackets(&manager_)); |
@@ -510,13 +510,13 @@ TEST_F(QuicSentPacketManagerTest, LoseButDontRetransmitRevivedPacket) { |
SendDataPacket(4); |
// Ack 2 and 3, and mark 1 as revived. |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 3; |
- received_info.missing_packets.insert(1); |
- received_info.revived_packets.insert(1); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 3; |
+ ack_frame.missing_packets.insert(1); |
+ ack_frame.revived_packets.insert(1); |
QuicPacketSequenceNumber acked[] = { 2, 3 }; |
ExpectAcksAndLosses(true, acked, arraysize(acked), NULL, 0); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
EXPECT_FALSE(manager_.HasPendingRetransmissions()); |
QuicPacketSequenceNumber unacked[] = { 1, 4 }; |
@@ -526,9 +526,9 @@ TEST_F(QuicSentPacketManagerTest, LoseButDontRetransmitRevivedPacket) { |
VerifyRetransmittablePackets(retransmittable, arraysize(retransmittable)); |
// Ack the 4th packet and expect the 1st to be considered lost. |
- received_info.largest_observed = 4; |
+ ack_frame.largest_observed = 4; |
ExpectAckAndLoss(true, 4, 1); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
EXPECT_FALSE(manager_.HasPendingRetransmissions()); |
VerifyRetransmittablePackets(NULL, 0); |
@@ -542,13 +542,13 @@ TEST_F(QuicSentPacketManagerTest, MarkLostThenReviveAndDontRetransmitPacket) { |
SendFecPacket(5); |
// Ack 2, 3, and 4, and expect the 1st to be considered lost. |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 4; |
- received_info.missing_packets.insert(1); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 4; |
+ ack_frame.missing_packets.insert(1); |
QuicPacketSequenceNumber acked[] = { 2, 3, 4 }; |
QuicPacketSequenceNumber lost[] = { 1 }; |
ExpectAcksAndLosses(true, acked, arraysize(acked), lost, arraysize(lost)); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
EXPECT_TRUE(manager_.HasPendingRetransmissions()); |
QuicPacketSequenceNumber unacked[] = { 1, 5 }; |
@@ -558,10 +558,10 @@ TEST_F(QuicSentPacketManagerTest, MarkLostThenReviveAndDontRetransmitPacket) { |
// Ack 5th packet (FEC) and revive 1st packet. 1st packet should now be |
// removed from pending retransmissions map. |
- received_info.largest_observed = 5; |
- received_info.revived_packets.insert(1); |
+ ack_frame.largest_observed = 5; |
+ ack_frame.revived_packets.insert(1); |
ExpectAck(5); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
EXPECT_FALSE(manager_.HasPendingRetransmissions()); |
VerifyRetransmittablePackets(NULL, 0); |
@@ -575,17 +575,17 @@ TEST_F(QuicSentPacketManagerTest, TruncatedAck) { |
RetransmitAndSendPacket(4, 5); |
// Truncated ack with 4 NACKs, so the first packet is lost. |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 4; |
- received_info.missing_packets.insert(1); |
- received_info.missing_packets.insert(2); |
- received_info.missing_packets.insert(3); |
- received_info.missing_packets.insert(4); |
- received_info.is_truncated = true; |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 4; |
+ ack_frame.missing_packets.insert(1); |
+ ack_frame.missing_packets.insert(2); |
+ ack_frame.missing_packets.insert(3); |
+ ack_frame.missing_packets.insert(4); |
+ ack_frame.is_truncated = true; |
QuicPacketSequenceNumber lost[] = { 1 }; |
ExpectAcksAndLosses(true, NULL, 0, lost, arraysize(lost)); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
// High water mark will be raised. |
QuicPacketSequenceNumber unacked[] = { 2, 3, 4, 5 }; |
@@ -607,25 +607,25 @@ TEST_F(QuicSentPacketManagerTest, AckPreviousTransmissionThenTruncatedAck) { |
// Ack previous transmission |
{ |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 2; |
- received_info.missing_packets.insert(1); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 2; |
+ ack_frame.missing_packets.insert(1); |
ExpectAck(2); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
EXPECT_TRUE(manager_.IsUnacked(4)); |
} |
// Truncated ack with 4 NACKs |
{ |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 6; |
- received_info.missing_packets.insert(3); |
- received_info.missing_packets.insert(4); |
- received_info.missing_packets.insert(5); |
- received_info.missing_packets.insert(6); |
- received_info.is_truncated = true; |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 6; |
+ ack_frame.missing_packets.insert(3); |
+ ack_frame.missing_packets.insert(4); |
+ ack_frame.missing_packets.insert(5); |
+ ack_frame.missing_packets.insert(6); |
+ ack_frame.is_truncated = true; |
ExpectAckAndLoss(false, 1, 3); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
} |
// High water mark will be raised. |
@@ -673,9 +673,9 @@ TEST_F(QuicSentPacketManagerTest, GetLeastUnackedPacketAndDiscard) { |
VerifyRetransmittablePackets(NULL, 0); |
// Ack 2, which has never been sent, so there's no rtt update. |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 2; |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 2; |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
EXPECT_EQ(3u, manager_.GetLeastUnackedSentPacket()); |
} |
@@ -713,20 +713,20 @@ TEST_F(QuicSentPacketManagerTest, AckAckAndUpdateRtt) { |
SendAckPacket(2); |
// Now ack the ack and expect an RTT update. |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 2; |
- received_info.delta_time_largest_observed = |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 2; |
+ ack_frame.delta_time_largest_observed = |
QuicTime::Delta::FromMilliseconds(5); |
ExpectAck(1); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
SendAckPacket(3); |
// Now ack the ack and expect only an RTT update. |
- received_info.largest_observed = 3; |
+ ack_frame.largest_observed = 3; |
ExpectUpdatedRtt(3); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
} |
TEST_F(QuicSentPacketManagerTest, Rtt) { |
@@ -736,11 +736,11 @@ TEST_F(QuicSentPacketManagerTest, Rtt) { |
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(20)); |
ExpectAck(sequence_number); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = sequence_number; |
- received_info.delta_time_largest_observed = |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = sequence_number; |
+ ack_frame.delta_time_largest_observed = |
QuicTime::Delta::FromMilliseconds(5); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
EXPECT_EQ(expected_rtt, |
QuicSentPacketManagerPeer::GetRttStats(&manager_)->latest_rtt()); |
} |
@@ -755,11 +755,11 @@ TEST_F(QuicSentPacketManagerTest, RttWithInvalidDelta) { |
clock_.AdvanceTime(expected_rtt); |
ExpectAck(sequence_number); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = sequence_number; |
- received_info.delta_time_largest_observed = |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = sequence_number; |
+ ack_frame.delta_time_largest_observed = |
QuicTime::Delta::FromMilliseconds(11); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
EXPECT_EQ(expected_rtt, |
QuicSentPacketManagerPeer::GetRttStats(&manager_)->latest_rtt()); |
} |
@@ -773,10 +773,10 @@ TEST_F(QuicSentPacketManagerTest, RttWithInfiniteDelta) { |
clock_.AdvanceTime(expected_rtt); |
ExpectAck(sequence_number); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = sequence_number; |
- received_info.delta_time_largest_observed = QuicTime::Delta::Infinite(); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = sequence_number; |
+ ack_frame.delta_time_largest_observed = QuicTime::Delta::Infinite(); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
EXPECT_EQ(expected_rtt, |
QuicSentPacketManagerPeer::GetRttStats(&manager_)->latest_rtt()); |
} |
@@ -790,10 +790,10 @@ TEST_F(QuicSentPacketManagerTest, RttZeroDelta) { |
clock_.AdvanceTime(expected_rtt); |
ExpectAck(sequence_number); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = sequence_number; |
- received_info.delta_time_largest_observed = QuicTime::Delta::Zero(); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = sequence_number; |
+ ack_frame.delta_time_largest_observed = QuicTime::Delta::Zero(); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
EXPECT_EQ(expected_rtt, |
QuicSentPacketManagerPeer::GetRttStats(&manager_)->latest_rtt()); |
} |
@@ -831,19 +831,19 @@ TEST_F(QuicSentPacketManagerTest, TailLossProbeTimeout) { |
// Ack the third and ensure the first two are still pending. |
ExpectAck(3); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 3; |
- received_info.missing_packets.insert(1); |
- received_info.missing_packets.insert(2); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 3; |
+ ack_frame.missing_packets.insert(1); |
+ ack_frame.missing_packets.insert(2); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
EXPECT_TRUE(QuicSentPacketManagerPeer::HasPendingPackets(&manager_)); |
// Acking two more packets will lose both of them due to nacks. |
- received_info.largest_observed = 5; |
+ ack_frame.largest_observed = 5; |
QuicPacketSequenceNumber lost[] = { 1, 2 }; |
ExpectAcksAndLosses(false, NULL, 0, lost, arraysize(lost)); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
EXPECT_FALSE(manager_.HasPendingRetransmissions()); |
EXPECT_FALSE(QuicSentPacketManagerPeer::HasPendingPackets(&manager_)); |
@@ -931,13 +931,13 @@ TEST_F(QuicSentPacketManagerTest, CryptoHandshakeTimeout) { |
// and ensure the first four crypto packets get abandoned, but not lost. |
QuicPacketSequenceNumber acked[] = { 3, 4, 5, 8, 9 }; |
ExpectAcksAndLosses(true, acked, arraysize(acked), NULL, 0); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 9; |
- received_info.missing_packets.insert(1); |
- received_info.missing_packets.insert(2); |
- received_info.missing_packets.insert(6); |
- received_info.missing_packets.insert(7); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 9; |
+ ack_frame.missing_packets.insert(1); |
+ ack_frame.missing_packets.insert(2); |
+ ack_frame.missing_packets.insert(6); |
+ ack_frame.missing_packets.insert(7); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
EXPECT_FALSE(QuicSentPacketManagerPeer::HasUnackedCryptoPackets(&manager_)); |
} |
@@ -991,10 +991,10 @@ TEST_F(QuicSentPacketManagerTest, CryptoHandshakeSpuriousRetransmission) { |
// Now ack the second crypto packet, and ensure the first gets removed, but |
// the third does not. |
ExpectUpdatedRtt(2); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 2; |
- received_info.missing_packets.insert(1); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 2; |
+ ack_frame.missing_packets.insert(1); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
EXPECT_FALSE(QuicSentPacketManagerPeer::HasUnackedCryptoPackets(&manager_)); |
QuicPacketSequenceNumber unacked[] = { 3 }; |
@@ -1064,12 +1064,12 @@ TEST_F(QuicSentPacketManagerTest, |
EXPECT_FALSE(QuicSentPacketManagerPeer::HasPendingPackets(&manager_)); |
// Ensure both packets get discarded when packet 2 is acked. |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 3; |
- received_info.missing_packets.insert(1); |
- received_info.missing_packets.insert(2); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 3; |
+ ack_frame.missing_packets.insert(1); |
+ ack_frame.missing_packets.insert(2); |
ExpectUpdatedRtt(3); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
VerifyUnackedPackets(NULL, 0); |
VerifyRetransmittablePackets(NULL, 0); |
} |
@@ -1116,20 +1116,20 @@ TEST_F(QuicSentPacketManagerTest, ResetRecentMinRTTWithEmptyWindow) { |
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(100)); |
// Ack two packets with 100ms RTT observations. |
- ReceivedPacketInfo received_info; |
- received_info.delta_time_largest_observed = QuicTime::Delta::Zero(); |
- received_info.largest_observed = 1; |
+ QuicAckFrame ack_frame; |
+ ack_frame.delta_time_largest_observed = QuicTime::Delta::Zero(); |
+ ack_frame.largest_observed = 1; |
ExpectAck(1); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
// First ack does not change recent min rtt. |
EXPECT_EQ(min_rtt, |
QuicSentPacketManagerPeer::GetRttStats( |
&manager_)->recent_min_rtt()); |
- received_info.largest_observed = 2; |
+ ack_frame.largest_observed = 2; |
ExpectAck(2); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
EXPECT_EQ(min_rtt, |
QuicSentPacketManagerPeer::GetRttStats(&manager_)->min_rtt()); |
@@ -1258,12 +1258,12 @@ TEST_F(QuicSentPacketManagerTest, GetTransmissionTimeRTO) { |
EXPECT_EQ(expected_time, manager_.GetRetransmissionTime()); |
// Ack a packet and ensure the RTO goes back to the original value. |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 2; |
- received_info.missing_packets.insert(1); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 2; |
+ ack_frame.missing_packets.insert(1); |
ExpectUpdatedRtt(2); |
EXPECT_CALL(*send_algorithm_, RevertRetransmissionTimeout()); |
- manager_.OnIncomingAck(received_info, clock_.ApproximateNow()); |
+ manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow()); |
EXPECT_FALSE(manager_.HasPendingRetransmissions()); |
EXPECT_EQ(4 * kDefaultLength, |
QuicSentPacketManagerPeer::GetBytesInFlight(&manager_)); |
@@ -1337,10 +1337,10 @@ TEST_F(QuicSentPacketManagerTest, GetLossDelay) { |
ExpectAck(2); |
EXPECT_CALL(*loss_algorithm, DetectLostPackets(_, _, _, _)) |
.WillOnce(Return(SequenceNumberSet())); |
- ReceivedPacketInfo received_info; |
- received_info.largest_observed = 2; |
- received_info.missing_packets.insert(1); |
- manager_.OnIncomingAck(received_info, clock_.Now()); |
+ QuicAckFrame ack_frame; |
+ ack_frame.largest_observed = 2; |
+ ack_frame.missing_packets.insert(1); |
+ manager_.OnIncomingAck(ack_frame, clock_.Now()); |
QuicTime timeout(clock_.Now().Add(QuicTime::Delta::FromMilliseconds(10))); |
EXPECT_CALL(*loss_algorithm, GetLossTimeout()) |