OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/quic_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/test_tools/quic_config_peer.h" | 8 #include "net/quic/test_tools/quic_config_peer.h" |
9 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" | 9 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" |
10 #include "net/quic/test_tools/quic_test_utils.h" | 10 #include "net/quic/test_tools/quic_test_utils.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 QuicSentPacketManagerTest() | 44 QuicSentPacketManagerTest() |
45 : manager_(true, &clock_, &stats_, kFixRate, kNack), | 45 : manager_(true, &clock_, &stats_, kFixRate, kNack), |
46 send_algorithm_(new StrictMock<MockSendAlgorithm>) { | 46 send_algorithm_(new StrictMock<MockSendAlgorithm>) { |
47 QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_); | 47 QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_); |
48 // Disable tail loss probes for most tests. | 48 // Disable tail loss probes for most tests. |
49 QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 0); | 49 QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 0); |
50 // Advance the time 1s so the send times are never QuicTime::Zero. | 50 // Advance the time 1s so the send times are never QuicTime::Zero. |
51 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000)); | 51 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000)); |
52 } | 52 } |
53 | 53 |
54 virtual ~QuicSentPacketManagerTest() { | 54 virtual ~QuicSentPacketManagerTest() OVERRIDE { |
55 STLDeleteElements(&packets_); | 55 STLDeleteElements(&packets_); |
56 } | 56 } |
57 | 57 |
58 QuicByteCount BytesInFlight() { | 58 QuicByteCount BytesInFlight() { |
59 return QuicSentPacketManagerPeer::GetBytesInFlight(&manager_); | 59 return QuicSentPacketManagerPeer::GetBytesInFlight(&manager_); |
60 } | 60 } |
61 void VerifyUnackedPackets(QuicPacketSequenceNumber* packets, | 61 void VerifyUnackedPackets(QuicPacketSequenceNumber* packets, |
62 size_t num_packets) { | 62 size_t num_packets) { |
63 if (num_packets == 0) { | 63 if (num_packets == 0) { |
64 EXPECT_FALSE(manager_.HasUnackedPackets()); | 64 EXPECT_FALSE(manager_.HasUnackedPackets()); |
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 | 1268 |
1269 EXPECT_EQ(kTime, | 1269 EXPECT_EQ(kTime, |
1270 QuicSentPacketManagerPeer::GetLossAlgorithm( | 1270 QuicSentPacketManagerPeer::GetLossAlgorithm( |
1271 &manager_)->GetLossDetectionType()); | 1271 &manager_)->GetLossDetectionType()); |
1272 } | 1272 } |
1273 | 1273 |
1274 | 1274 |
1275 } // namespace | 1275 } // namespace |
1276 } // namespace test | 1276 } // namespace test |
1277 } // namespace net | 1277 } // namespace net |
OLD | NEW |