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

Side by Side Diff: net/quic/congestion_control/tcp_loss_algorithm_test.cc

Issue 306573002: Add an IncreaseLargestObserved to QuicUnackedPacketMap to remove the rtt (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/net.gypi ('k') | net/quic/quic_connection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "net/quic/congestion_control/rtt_stats.h" 9 #include "net/quic/congestion_control/rtt_stats.h"
10 #include "net/quic/congestion_control/tcp_loss_algorithm.h" 10 #include "net/quic/congestion_control/tcp_loss_algorithm.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 VerifyLosses(kNumSentPackets, lost3, arraysize(lost3)); 161 VerifyLosses(kNumSentPackets, lost3, arraysize(lost3));
162 EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); 162 EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
163 } 163 }
164 164
165 TEST_F(TcpLossAlgorithmTest, DontEarlyRetransmitNeuteredPacket) { 165 TEST_F(TcpLossAlgorithmTest, DontEarlyRetransmitNeuteredPacket) {
166 const size_t kNumSentPackets = 2; 166 const size_t kNumSentPackets = 2;
167 // Transmit 2 packets. 167 // Transmit 2 packets.
168 for (size_t i = 1; i <= kNumSentPackets; ++i) { 168 for (size_t i = 1; i <= kNumSentPackets; ++i) {
169 SendDataPacket(i); 169 SendDataPacket(i);
170 } 170 }
171 // Neuter packet 1.
172 unacked_packets_.RemoveRetransmittability(1);
173
171 // Early retransmit when the final packet gets acked and the first is nacked. 174 // Early retransmit when the final packet gets acked and the first is nacked.
175 unacked_packets_.IncreaseLargestObserved(2);
172 unacked_packets_.SetNotPending(2); 176 unacked_packets_.SetNotPending(2);
173 unacked_packets_.NackPacket(1, 1); 177 unacked_packets_.NackPacket(1, 1);
174 unacked_packets_.RemoveRetransmittability(1, 1);
175 VerifyLosses(2, NULL, 0); 178 VerifyLosses(2, NULL, 0);
176 EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); 179 EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
177 } 180 }
178 181
179 } // namespace test 182 } // namespace test
180 } // namespace net 183 } // namespace net
OLDNEW
« no previous file with comments | « net/net.gypi ('k') | net/quic/quic_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698