| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class MockDebugDelegate : public QuicSentPacketManager::DebugDelegate { | 42 class MockDebugDelegate : public QuicSentPacketManager::DebugDelegate { |
| 43 public: | 43 public: |
| 44 MOCK_METHOD2(OnSpuriousPacketRetransmission, | 44 MOCK_METHOD2(OnSpuriousPacketRetransmission, |
| 45 void(TransmissionType transmission_type, | 45 void(TransmissionType transmission_type, |
| 46 QuicByteCount byte_size)); | 46 QuicByteCount byte_size)); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 class QuicSentPacketManagerTest : public ::testing::TestWithParam<bool> { | 49 class QuicSentPacketManagerTest : public ::testing::TestWithParam<bool> { |
| 50 protected: | 50 protected: |
| 51 QuicSentPacketManagerTest() | 51 QuicSentPacketManagerTest() |
| 52 : manager_(Perspective::IS_SERVER, &clock_, &stats_, kCubic, kNack, true), | 52 : manager_(Perspective::IS_SERVER, &clock_, &stats_, kCubic, kNack), |
| 53 send_algorithm_(new StrictMock<MockSendAlgorithm>), | 53 send_algorithm_(new StrictMock<MockSendAlgorithm>), |
| 54 network_change_visitor_(new StrictMock<MockNetworkChangeVisitor>) { | 54 network_change_visitor_(new StrictMock<MockNetworkChangeVisitor>) { |
| 55 QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_); | 55 QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_); |
| 56 // Disable tail loss probes for most tests. | 56 // Disable tail loss probes for most tests. |
| 57 QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 0); | 57 QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 0); |
| 58 // Advance the time 1s so the send times are never QuicTime::Zero. | 58 // Advance the time 1s so the send times are never QuicTime::Zero. |
| 59 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000)); | 59 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000)); |
| 60 manager_.set_network_change_visitor(network_change_visitor_.get()); | 60 manager_.set_network_change_visitor(network_change_visitor_.get()); |
| 61 | 61 |
| 62 EXPECT_CALL(*send_algorithm_, HasReliableBandwidthEstimate()) | 62 EXPECT_CALL(*send_algorithm_, HasReliableBandwidthEstimate()) |
| (...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 | 1680 |
| 1681 EXPECT_CALL(*send_algorithm_, ResumeConnectionState(_, false)); | 1681 EXPECT_CALL(*send_algorithm_, ResumeConnectionState(_, false)); |
| 1682 manager_.ResumeConnectionState(cached_network_params, false); | 1682 manager_.ResumeConnectionState(cached_network_params, false); |
| 1683 EXPECT_EQ(kRttMs * kNumMicrosPerMilli, | 1683 EXPECT_EQ(kRttMs * kNumMicrosPerMilli, |
| 1684 static_cast<uint64>(manager_.GetRttStats()->initial_rtt_us())); | 1684 static_cast<uint64>(manager_.GetRttStats()->initial_rtt_us())); |
| 1685 } | 1685 } |
| 1686 | 1686 |
| 1687 } // namespace | 1687 } // namespace |
| 1688 } // namespace test | 1688 } // namespace test |
| 1689 } // namespace net | 1689 } // namespace net |
| OLD | NEW |