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

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

Issue 1570363002: relnote: n/a test-only change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@03_CL_111628983
Patch Set: change upstream Created 4 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
« no previous file with comments | « net/quic/congestion_control/general_loss_algorithm_test.cc ('k') | no next file » | 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 "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 15 matching lines...) Expand all
26 protected: 26 protected:
27 TcpLossAlgorithmTest() { 27 TcpLossAlgorithmTest() {
28 rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(100), 28 rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(100),
29 QuicTime::Delta::Zero(), clock_.Now()); 29 QuicTime::Delta::Zero(), clock_.Now());
30 } 30 }
31 31
32 ~TcpLossAlgorithmTest() override { STLDeleteElements(&packets_); } 32 ~TcpLossAlgorithmTest() override { STLDeleteElements(&packets_); }
33 33
34 void SendDataPacket(QuicPacketNumber packet_number) { 34 void SendDataPacket(QuicPacketNumber packet_number) {
35 packets_.push_back(new QuicEncryptedPacket(nullptr, kDefaultLength)); 35 packets_.push_back(new QuicEncryptedPacket(nullptr, kDefaultLength));
36 RetransmittableFrames* frames = new RetransmittableFrames();
37 QuicStreamFrame* frame = new QuicStreamFrame();
38 frame->stream_id = kHeadersStreamId;
39 frames->AddFrame(QuicFrame(frame));
36 SerializedPacket packet(kDefaultPathId, packet_number, 40 SerializedPacket packet(kDefaultPathId, packet_number,
37 PACKET_1BYTE_PACKET_NUMBER, packets_.back(), 0, 41 PACKET_1BYTE_PACKET_NUMBER, packets_.back(), 0,
38 new RetransmittableFrames(), false, false); 42 frames, false, false);
39 unacked_packets_.AddSentPacket(&packet, 0, NOT_RETRANSMISSION, clock_.Now(), 43 unacked_packets_.AddSentPacket(&packet, 0, NOT_RETRANSMISSION, clock_.Now(),
40 1000, true); 44 1000, true);
41 } 45 }
42 46
43 void VerifyLosses(QuicPacketNumber largest_observed, 47 void VerifyLosses(QuicPacketNumber largest_observed,
44 QuicPacketNumber* losses_expected, 48 QuicPacketNumber* losses_expected,
45 size_t num_losses) { 49 size_t num_losses) {
46 PacketNumberSet lost_packets = loss_algorithm_.DetectLostPackets( 50 PacketNumberSet lost_packets = loss_algorithm_.DetectLostPackets(
47 unacked_packets_, clock_.Now(), largest_observed, rtt_stats_); 51 unacked_packets_, clock_.Now(), largest_observed, rtt_stats_);
48 EXPECT_EQ(num_losses, lost_packets.size()); 52 EXPECT_EQ(num_losses, lost_packets.size());
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 unacked_packets_.IncreaseLargestObserved(2); 207 unacked_packets_.IncreaseLargestObserved(2);
204 unacked_packets_.RemoveFromInFlight(2); 208 unacked_packets_.RemoveFromInFlight(2);
205 unacked_packets_.NackPacket(1, 1); 209 unacked_packets_.NackPacket(1, 1);
206 QuicPacketNumber lost[] = {1}; 210 QuicPacketNumber lost[] = {1};
207 VerifyLosses(2, lost, arraysize(lost)); 211 VerifyLosses(2, lost, arraysize(lost));
208 } 212 }
209 213
210 } // namespace 214 } // namespace
211 } // namespace test 215 } // namespace test
212 } // namespace net 216 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/general_loss_algorithm_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698