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

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

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 unacked_packets_.RemoveRetransmittability(1); 186 unacked_packets_.RemoveRetransmittability(1);
187 187
188 // Early retransmit when the final packet gets acked and the first is nacked. 188 // Early retransmit when the final packet gets acked and the first is nacked.
189 unacked_packets_.IncreaseLargestObserved(2); 189 unacked_packets_.IncreaseLargestObserved(2);
190 unacked_packets_.RemoveFromInFlight(2); 190 unacked_packets_.RemoveFromInFlight(2);
191 unacked_packets_.NackPacket(1, 1); 191 unacked_packets_.NackPacket(1, 1);
192 VerifyLosses(2, nullptr, 0); 192 VerifyLosses(2, nullptr, 0);
193 EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); 193 EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
194 } 194 }
195 195
196 TEST_F(TcpLossAlgorithmTest, AlwaysLosePacketSent1RTTEarlier) {
197 // Transmit 1 packet and then wait an rtt plus 1ms.
198 SendDataPacket(1);
199 clock_.AdvanceTime(
200 rtt_stats_.smoothed_rtt().Add(QuicTime::Delta::FromMilliseconds(1)));
201
202 // Transmit 2 packets.
203 SendDataPacket(2);
204 SendDataPacket(3);
205
206 // Wait another RTT and ack 2.
207 clock_.AdvanceTime(rtt_stats_.smoothed_rtt());
208 unacked_packets_.IncreaseLargestObserved(2);
209 unacked_packets_.RemoveFromInFlight(2);
210 unacked_packets_.NackPacket(1, 1);
211 QuicPacketSequenceNumber lost[] = {1};
212 VerifyLosses(2, lost, arraysize(lost));
213 }
214
196 } // namespace 215 } // namespace
197 } // namespace test 216 } // namespace test
198 } // namespace net 217 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_loss_algorithm.cc ('k') | net/quic/crypto/crypto_handshake_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698