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 26 matching lines...) Expand all Loading... |
37 class MockDebugDelegate : public QuicSentPacketManager::DebugDelegate { | 37 class MockDebugDelegate : public QuicSentPacketManager::DebugDelegate { |
38 public: | 38 public: |
39 MOCK_METHOD2(OnSpuriousPacketRetransmition, | 39 MOCK_METHOD2(OnSpuriousPacketRetransmition, |
40 void(TransmissionType transmission_type, | 40 void(TransmissionType transmission_type, |
41 QuicByteCount byte_size)); | 41 QuicByteCount byte_size)); |
42 }; | 42 }; |
43 | 43 |
44 class QuicSentPacketManagerTest : public ::testing::TestWithParam<bool> { | 44 class QuicSentPacketManagerTest : public ::testing::TestWithParam<bool> { |
45 protected: | 45 protected: |
46 QuicSentPacketManagerTest() | 46 QuicSentPacketManagerTest() |
47 : manager_(true, &clock_, &stats_, kFixRateCongestionControl, 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 } | 56 } |
57 | 57 |
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1428 .WillOnce(Return(100 * kDefaultTCPMSS)); | 1428 .WillOnce(Return(100 * kDefaultTCPMSS)); |
1429 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); | 1429 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); |
1430 manager_.SetFromConfig(config); | 1430 manager_.SetFromConfig(config); |
1431 | 1431 |
1432 EXPECT_TRUE(manager_.using_pacing()); | 1432 EXPECT_TRUE(manager_.using_pacing()); |
1433 } | 1433 } |
1434 | 1434 |
1435 } // namespace | 1435 } // namespace |
1436 } // namespace test | 1436 } // namespace test |
1437 } // namespace net | 1437 } // namespace net |
OLD | NEW |