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/quic_flags.h" | 8 #include "net/quic/quic_flags.h" |
9 #include "net/quic/test_tools/quic_config_peer.h" | 9 #include "net/quic/test_tools/quic_config_peer.h" |
10 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" | 10 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 QuicSentPacketManagerTest() | 46 QuicSentPacketManagerTest() |
47 : manager_(true, &clock_, &stats_, kCubic, kNack), | 47 : manager_(true, &clock_, &stats_, kCubic, kNack), |
48 send_algorithm_(new StrictMock<MockSendAlgorithm>), | 48 send_algorithm_(new StrictMock<MockSendAlgorithm>), |
49 network_change_visitor_(new StrictMock<MockNetworkChangeVisitor>) { | 49 network_change_visitor_(new StrictMock<MockNetworkChangeVisitor>) { |
50 QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_); | 50 QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_); |
51 // Disable tail loss probes for most tests. | 51 // Disable tail loss probes for most tests. |
52 QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 0); | 52 QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 0); |
53 // Advance the time 1s so the send times are never QuicTime::Zero. | 53 // Advance the time 1s so the send times are never QuicTime::Zero. |
54 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000)); | 54 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000)); |
55 manager_.set_network_change_visitor(network_change_visitor_.get()); | 55 manager_.set_network_change_visitor(network_change_visitor_.get()); |
| 56 |
| 57 EXPECT_CALL(*send_algorithm_, HasReliableBandwidthEstimate()) |
| 58 .Times(AnyNumber()); |
| 59 EXPECT_CALL(*send_algorithm_, BandwidthEstimate()) |
| 60 .Times(AnyNumber()) |
| 61 .WillRepeatedly(Return(QuicBandwidth::Zero())); |
| 62 EXPECT_CALL(*send_algorithm_, InSlowStart()).Times(AnyNumber()); |
| 63 EXPECT_CALL(*send_algorithm_, InRecovery()).Times(AnyNumber()); |
56 } | 64 } |
57 | 65 |
58 virtual ~QuicSentPacketManagerTest() OVERRIDE { | 66 virtual ~QuicSentPacketManagerTest() OVERRIDE { |
59 STLDeleteElements(&packets_); | 67 STLDeleteElements(&packets_); |
60 } | 68 } |
61 | 69 |
62 QuicByteCount BytesInFlight() { | 70 QuicByteCount BytesInFlight() { |
63 return QuicSentPacketManagerPeer::GetBytesInFlight(&manager_); | 71 return QuicSentPacketManagerPeer::GetBytesInFlight(&manager_); |
64 } | 72 } |
65 void VerifyUnackedPackets(QuicPacketSequenceNumber* packets, | 73 void VerifyUnackedPackets(QuicPacketSequenceNumber* packets, |
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 .WillOnce(Return(100 * kDefaultTCPMSS)); | 1439 .WillOnce(Return(100 * kDefaultTCPMSS)); |
1432 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); | 1440 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); |
1433 manager_.SetFromConfig(config); | 1441 manager_.SetFromConfig(config); |
1434 | 1442 |
1435 EXPECT_TRUE(manager_.using_pacing()); | 1443 EXPECT_TRUE(manager_.using_pacing()); |
1436 } | 1444 } |
1437 | 1445 |
1438 } // namespace | 1446 } // namespace |
1439 } // namespace test | 1447 } // namespace test |
1440 } // namespace net | 1448 } // namespace net |
OLD | NEW |