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

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

Issue 1542123002: Add path_id to SerializedPacket. No functional change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110310127
Patch Set: Created 5 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 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 "net/quic/congestion_control/tcp_loss_algorithm.h" 5 #include "net/quic/congestion_control/tcp_loss_algorithm.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 18 matching lines...) Expand all
29 QuicTime::Delta::Zero(), 29 QuicTime::Delta::Zero(),
30 clock_.Now()); 30 clock_.Now());
31 } 31 }
32 32
33 ~TcpLossAlgorithmTest() override { 33 ~TcpLossAlgorithmTest() override {
34 STLDeleteElements(&packets_); 34 STLDeleteElements(&packets_);
35 } 35 }
36 36
37 void SendDataPacket(QuicPacketNumber packet_number) { 37 void SendDataPacket(QuicPacketNumber packet_number) {
38 packets_.push_back(new QuicEncryptedPacket(nullptr, kDefaultLength)); 38 packets_.push_back(new QuicEncryptedPacket(nullptr, kDefaultLength));
39 SerializedPacket packet(packet_number, PACKET_1BYTE_PACKET_NUMBER, 39 SerializedPacket packet(kDefaultPathId, packet_number,
40 packets_.back(), 0, new RetransmittableFrames(), 40 PACKET_1BYTE_PACKET_NUMBER, packets_.back(), 0,
41 false, false); 41 new RetransmittableFrames(), false, false);
42 unacked_packets_.AddSentPacket(&packet, 0, NOT_RETRANSMISSION, clock_.Now(), 42 unacked_packets_.AddSentPacket(&packet, 0, NOT_RETRANSMISSION, clock_.Now(),
43 1000, true); 43 1000, true);
44 } 44 }
45 45
46 void VerifyLosses(QuicPacketNumber largest_observed, 46 void VerifyLosses(QuicPacketNumber largest_observed,
47 QuicPacketNumber* losses_expected, 47 QuicPacketNumber* losses_expected,
48 size_t num_losses) { 48 size_t num_losses) {
49 PacketNumberSet lost_packets = loss_algorithm_.DetectLostPackets( 49 PacketNumberSet lost_packets = loss_algorithm_.DetectLostPackets(
50 unacked_packets_, clock_.Now(), largest_observed, rtt_stats_); 50 unacked_packets_, clock_.Now(), largest_observed, rtt_stats_);
51 EXPECT_EQ(num_losses, lost_packets.size()); 51 EXPECT_EQ(num_losses, lost_packets.size());
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 unacked_packets_.IncreaseLargestObserved(2); 206 unacked_packets_.IncreaseLargestObserved(2);
207 unacked_packets_.RemoveFromInFlight(2); 207 unacked_packets_.RemoveFromInFlight(2);
208 unacked_packets_.NackPacket(1, 1); 208 unacked_packets_.NackPacket(1, 1);
209 QuicPacketNumber lost[] = {1}; 209 QuicPacketNumber lost[] = {1};
210 VerifyLosses(2, lost, arraysize(lost)); 210 VerifyLosses(2, lost, arraysize(lost));
211 } 211 }
212 212
213 } // namespace 213 } // namespace
214 } // namespace test 214 } // namespace test
215 } // namespace net 215 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/general_loss_algorithm_test.cc ('k') | net/quic/congestion_control/time_loss_algorithm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698