Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: net/quic/quic_connection_test.cc

Issue 109993008: Fix QUIC's TCP style retransmission logic to only send a maximum of 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection_test.cc
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index 05aeeeb74e5572b547dd670655de531c83e28ee4..c35918bc0f918b64bbc5668eeb33448d860435ad 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -918,8 +918,8 @@ TEST_F(QuicConnectionTest, TruncatedAck) {
EXPECT_CALL(entropy_calculator_,
EntropyHash(511)).WillOnce(testing::Return(0));
EXPECT_CALL(*send_algorithm_, OnPacketAcked(_, _, _)).Times(256);
- EXPECT_CALL(*send_algorithm_, OnPacketLost(_, _)).Times(10);
- EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(_, _)).Times(10);
+ EXPECT_CALL(*send_algorithm_, OnPacketLost(_, _)).Times(2);
+ EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(_, _)).Times(2);
ProcessAckPacket(&frame);
QuicReceivedPacketManager* received_packet_manager =
@@ -933,8 +933,8 @@ TEST_F(QuicConnectionTest, TruncatedAck) {
// Removing one missing packet allows us to ack 192 and one more range.
EXPECT_CALL(*send_algorithm_, OnPacketAcked(_, _, _)).Times(2);
- EXPECT_CALL(*send_algorithm_, OnPacketLost(_, _)).Times(10);
- EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(_, _)).Times(10);
+ EXPECT_CALL(*send_algorithm_, OnPacketLost(_, _)).Times(2);
+ EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(_, _)).Times(2);
ProcessAckPacket(&frame);
EXPECT_EQ(num_packets,
received_packet_manager->peer_largest_observed_packet());
@@ -1788,7 +1788,7 @@ TEST_F(QuicConnectionTest, ResumptionAlarmThenWriteBlocked) {
TEST_F(QuicConnectionTest, LimitPacketsPerNack) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
EXPECT_CALL(*send_algorithm_, OnPacketAcked(15, _, _)).Times(1);
- EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(_, _)).Times(13);
+ EXPECT_CALL(*send_algorithm_, OnPacketAbandoned(_, _)).Times(4);
int offset = 0;
// Send packets 1 to 15.
for (int i = 0; i < 15; ++i) {
@@ -1806,15 +1806,14 @@ TEST_F(QuicConnectionTest, LimitPacketsPerNack) {
QuicConnectionPeer::GetSentEntropyHash(&connection_, 15) ^
QuicConnectionPeer::GetSentEntropyHash(&connection_, 14);
- // 13 packets have been NACK'd 3 times, but we limit retransmissions to 10.
- EXPECT_CALL(*send_algorithm_, OnPacketLost(_, _)).Times(10);
- EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(10);
+ // 13 packets have been NACK'd 3 times, but we limit retransmissions to 2.
+ EXPECT_CALL(*send_algorithm_, OnPacketLost(_, _)).Times(2);
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
ProcessAckPacket(&nack);
- // The next call should trigger retransmitting 3 more packets, because 14
- // only has 2 nacks so far.
- EXPECT_CALL(*send_algorithm_, OnPacketLost(_, _)).Times(3);
- EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(3);
+ // The next call should trigger retransmitting 2 more packets.
+ EXPECT_CALL(*send_algorithm_, OnPacketLost(_, _)).Times(2);
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
ProcessAckPacket(&nack);
}
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698