| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Common utilities for Quic tests | 5 // Common utilities for Quic tests |
| 6 | 6 |
| 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 const CongestionVector& lost_packets)); | 595 const CongestionVector& lost_packets)); |
| 596 MOCK_METHOD5(OnPacketSent, | 596 MOCK_METHOD5(OnPacketSent, |
| 597 bool(QuicTime, | 597 bool(QuicTime, |
| 598 QuicByteCount, | 598 QuicByteCount, |
| 599 QuicPacketNumber, | 599 QuicPacketNumber, |
| 600 QuicByteCount, | 600 QuicByteCount, |
| 601 HasRetransmittableData)); | 601 HasRetransmittableData)); |
| 602 MOCK_METHOD1(OnRetransmissionTimeout, void(bool)); | 602 MOCK_METHOD1(OnRetransmissionTimeout, void(bool)); |
| 603 MOCK_METHOD0(OnConnectionMigration, void()); | 603 MOCK_METHOD0(OnConnectionMigration, void()); |
| 604 MOCK_METHOD0(RevertRetransmissionTimeout, void()); | 604 MOCK_METHOD0(RevertRetransmissionTimeout, void()); |
| 605 MOCK_CONST_METHOD3(TimeUntilSend, | 605 MOCK_CONST_METHOD2(TimeUntilSend, |
| 606 QuicTime::Delta(QuicTime now, | 606 QuicTime::Delta(QuicTime now, |
| 607 QuicByteCount bytes_in_flight, | 607 QuicByteCount bytes_in_flight)); |
| 608 HasRetransmittableData)); | |
| 609 MOCK_CONST_METHOD0(PacingRate, QuicBandwidth(void)); | 608 MOCK_CONST_METHOD0(PacingRate, QuicBandwidth(void)); |
| 610 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void)); | 609 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void)); |
| 611 MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool()); | 610 MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool()); |
| 612 MOCK_METHOD1(OnRttUpdated, void(QuicPacketNumber)); | 611 MOCK_METHOD1(OnRttUpdated, void(QuicPacketNumber)); |
| 613 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void)); | 612 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void)); |
| 614 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount()); | 613 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount()); |
| 615 MOCK_CONST_METHOD0(InSlowStart, bool()); | 614 MOCK_CONST_METHOD0(InSlowStart, bool()); |
| 616 MOCK_CONST_METHOD0(InRecovery, bool()); | 615 MOCK_CONST_METHOD0(InRecovery, bool()); |
| 617 MOCK_CONST_METHOD0(GetSlowStartThreshold, QuicByteCount()); | 616 MOCK_CONST_METHOD0(GetSlowStartThreshold, QuicByteCount()); |
| 618 MOCK_CONST_METHOD0(GetCongestionControlType, CongestionControlType()); | 617 MOCK_CONST_METHOD0(GetCongestionControlType, CongestionControlType()); |
| 619 MOCK_METHOD2(ResumeConnectionState, | 618 MOCK_METHOD2(ResumeConnectionState, |
| 620 void(const CachedNetworkParameters&, bool)); | 619 void(const CachedNetworkParameters&, bool)); |
| 621 | 620 |
| 622 private: | 621 private: |
| 623 DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm); | 622 DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm); |
| 624 }; | 623 }; |
| 625 | 624 |
| 626 class MockLossAlgorithm : public LossDetectionInterface { | 625 class MockLossAlgorithm : public LossDetectionInterface { |
| 627 public: | 626 public: |
| 628 MockLossAlgorithm(); | 627 MockLossAlgorithm(); |
| 629 ~MockLossAlgorithm() override; | 628 ~MockLossAlgorithm() override; |
| 630 | 629 |
| 631 MOCK_CONST_METHOD0(GetLossDetectionType, LossDetectionType()); | 630 MOCK_CONST_METHOD0(GetLossDetectionType, LossDetectionType()); |
| 632 MOCK_METHOD4(DetectLosses, | 631 MOCK_METHOD4(DetectLosses, |
| 633 void(const QuicUnackedPacketMap& unacked_packets, | 632 void(const QuicUnackedPacketMap& unacked_packets, |
| 634 const QuicTime& time, | 633 QuicTime time, |
| 635 const RttStats& rtt_stats, | 634 const RttStats& rtt_stats, |
| 636 SendAlgorithmInterface::CongestionVector* packets_lost)); | 635 SendAlgorithmInterface::CongestionVector* packets_lost)); |
| 637 MOCK_CONST_METHOD0(GetLossTimeout, QuicTime()); | 636 MOCK_CONST_METHOD0(GetLossTimeout, QuicTime()); |
| 638 | 637 |
| 639 private: | 638 private: |
| 640 DISALLOW_COPY_AND_ASSIGN(MockLossAlgorithm); | 639 DISALLOW_COPY_AND_ASSIGN(MockLossAlgorithm); |
| 641 }; | 640 }; |
| 642 | 641 |
| 643 class TestEntropyCalculator | 642 class TestEntropyCalculator |
| 644 : public QuicReceivedEntropyHashCalculatorInterface { | 643 : public QuicReceivedEntropyHashCalculatorInterface { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 TestQuicSpdyServerSession** server_session); | 805 TestQuicSpdyServerSession** server_session); |
| 807 | 806 |
| 808 // Helper to generate client side stream ids, generalizes | 807 // Helper to generate client side stream ids, generalizes |
| 809 // kClientDataStreamId1 etc. above. | 808 // kClientDataStreamId1 etc. above. |
| 810 QuicStreamId QuicClientDataStreamId(int i); | 809 QuicStreamId QuicClientDataStreamId(int i); |
| 811 | 810 |
| 812 } // namespace test | 811 } // namespace test |
| 813 } // namespace net | 812 } // namespace net |
| 814 | 813 |
| 815 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 814 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |