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

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

Issue 887243005: Move is_fec_packet from QuicPacket to SerializedPacket in order to allow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/tcp_loss_algorithm_test.cc ('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/time_loss_algorithm.h" 10 #include "net/quic/congestion_control/time_loss_algorithm.h"
(...skipping 17 matching lines...) Expand all
28 rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(100), 28 rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(100),
29 QuicTime::Delta::Zero(), 29 QuicTime::Delta::Zero(),
30 clock_.Now()); 30 clock_.Now());
31 } 31 }
32 32
33 ~TimeLossAlgorithmTest() override { 33 ~TimeLossAlgorithmTest() override {
34 STLDeleteElements(&packets_); 34 STLDeleteElements(&packets_);
35 } 35 }
36 36
37 void SendDataPacket(QuicPacketSequenceNumber sequence_number) { 37 void SendDataPacket(QuicPacketSequenceNumber sequence_number) {
38 packets_.push_back(QuicPacket::NewDataPacket( 38 packets_.push_back(new QuicPacket(nullptr, kDefaultLength, false,
39 nullptr, kDefaultLength, false, PACKET_8BYTE_CONNECTION_ID, false, 39 PACKET_8BYTE_CONNECTION_ID, false,
40 PACKET_1BYTE_SEQUENCE_NUMBER)); 40 PACKET_1BYTE_SEQUENCE_NUMBER));
41 SerializedPacket packet(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER, 41 SerializedPacket packet(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER,
42 packets_.back(), 0, new RetransmittableFrames()); 42 packets_.back(), 0, new RetransmittableFrames());
43 unacked_packets_.AddSentPacket(packet, 0, NOT_RETRANSMISSION, clock_.Now(), 43 unacked_packets_.AddSentPacket(packet, 0, NOT_RETRANSMISSION, clock_.Now(),
44 1000, true); 44 1000, true);
45 } 45 }
46 46
47 void VerifyLosses(QuicPacketSequenceNumber largest_observed, 47 void VerifyLosses(QuicPacketSequenceNumber largest_observed,
48 QuicPacketSequenceNumber* losses_expected, 48 QuicPacketSequenceNumber* losses_expected,
49 size_t num_losses) { 49 size_t num_losses) {
50 SequenceNumberSet lost_packets = 50 SequenceNumberSet lost_packets =
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 loss_algorithm_.GetLossTimeout().Subtract(clock_.Now())); 144 loss_algorithm_.GetLossTimeout().Subtract(clock_.Now()));
145 clock_.AdvanceTime(rtt_stats_.smoothed_rtt().Multiply(0.25)); 145 clock_.AdvanceTime(rtt_stats_.smoothed_rtt().Multiply(0.25));
146 QuicPacketSequenceNumber lost[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; 146 QuicPacketSequenceNumber lost[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
147 VerifyLosses(10, lost, arraysize(lost)); 147 VerifyLosses(10, lost, arraysize(lost));
148 EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); 148 EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
149 } 149 }
150 150
151 } // namespace 151 } // namespace
152 } // namespace test 152 } // namespace test
153 } // namespace net 153 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_loss_algorithm_test.cc ('k') | net/quic/quic_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698