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

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

Issue 183683025: CL generated with data from dead-code analysis using Scythe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/quic/congestion_control/tcp_loss_algorithm_test.cc ('k') | net/quic/quic_connection.h » ('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/time_loss_algorithm.h" 9 #include "net/quic/congestion_control/time_loss_algorithm.h"
10 #include "net/quic/quic_unacked_packet_map.h" 10 #include "net/quic/quic_unacked_packet_map.h"
11 #include "net/quic/test_tools/mock_clock.h" 11 #include "net/quic/test_tools/mock_clock.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace net { 14 namespace net {
15 namespace test { 15 namespace test {
16 namespace { 16 namespace {
17 17
18 class TimeLossAlgorithmTest : public ::testing::Test { 18 class TimeLossAlgorithmTest : public ::testing::Test {
19 protected: 19 protected:
20 TimeLossAlgorithmTest() 20 TimeLossAlgorithmTest()
21 : unacked_packets_(true), 21 : unacked_packets_(),
22 srtt_(QuicTime::Delta::FromMilliseconds(100)) { } 22 srtt_(QuicTime::Delta::FromMilliseconds(100)) { }
23 23
24 void SendDataPacket(QuicPacketSequenceNumber sequence_number) { 24 void SendDataPacket(QuicPacketSequenceNumber sequence_number) {
25 SerializedPacket packet(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER, 25 SerializedPacket packet(sequence_number, PACKET_1BYTE_SEQUENCE_NUMBER,
26 NULL, 0, new RetransmittableFrames()); 26 NULL, 0, new RetransmittableFrames());
27 unacked_packets_.AddPacket(packet); 27 unacked_packets_.AddPacket(packet);
28 unacked_packets_.SetPending(sequence_number, clock_.Now(), 1000); 28 unacked_packets_.SetPending(sequence_number, clock_.Now(), 1000);
29 } 29 }
30 30
31 void VerifyLosses(QuicPacketSequenceNumber largest_observed, 31 void VerifyLosses(QuicPacketSequenceNumber largest_observed,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 loss_algorithm_.GetLossTimeout().Subtract(clock_.Now())); 127 loss_algorithm_.GetLossTimeout().Subtract(clock_.Now()));
128 clock_.AdvanceTime(srtt_.Multiply(0.25)); 128 clock_.AdvanceTime(srtt_.Multiply(0.25));
129 QuicPacketSequenceNumber lost[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; 129 QuicPacketSequenceNumber lost[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
130 VerifyLosses(10, lost, arraysize(lost)); 130 VerifyLosses(10, lost, arraysize(lost));
131 EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout()); 131 EXPECT_EQ(QuicTime::Zero(), loss_algorithm_.GetLossTimeout());
132 } 132 }
133 133
134 } // namespace 134 } // namespace
135 } // namespace test 135 } // namespace test
136 } // namespace net 136 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_loss_algorithm_test.cc ('k') | net/quic/quic_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698