| 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 // These tests only work with pacing enabled. | 55 // These tests only work with pacing enabled. |
| 56 saved_FLAGS_quic_disable_pacing_ = FLAGS_quic_disable_pacing; | 56 saved_FLAGS_quic_disable_pacing_ = FLAGS_quic_disable_pacing; |
| 57 FLAGS_quic_disable_pacing = false; | 57 FLAGS_quic_disable_pacing = false; |
| 58 | 58 |
| 59 QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_); | 59 QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_); |
| 60 // Disable tail loss probes for most tests. | 60 // Disable tail loss probes for most tests. |
| 61 QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 0); | 61 QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 0); |
| 62 // Advance the time 1s so the send times are never QuicTime::Zero. | 62 // Advance the time 1s so the send times are never QuicTime::Zero. |
| (...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1662 | 1662 |
| 1663 EXPECT_CALL(*send_algorithm_, ResumeConnectionState(_, false)); | 1663 EXPECT_CALL(*send_algorithm_, ResumeConnectionState(_, false)); |
| 1664 manager_.ResumeConnectionState(cached_network_params, false); | 1664 manager_.ResumeConnectionState(cached_network_params, false); |
| 1665 EXPECT_EQ(kRttMs * kNumMicrosPerMilli, | 1665 EXPECT_EQ(kRttMs * kNumMicrosPerMilli, |
| 1666 static_cast<uint64>(manager_.GetRttStats()->initial_rtt_us())); | 1666 static_cast<uint64>(manager_.GetRttStats()->initial_rtt_us())); |
| 1667 } | 1667 } |
| 1668 | 1668 |
| 1669 } // namespace | 1669 } // namespace |
| 1670 } // namespace test | 1670 } // namespace test |
| 1671 } // namespace net | 1671 } // namespace net |
| OLD | NEW |