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 <string> | 10 #include <string> |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 | 749 |
750 MOCK_METHOD1(OnPublicResetPacket, void(const QuicPublicResetPacket&)); | 750 MOCK_METHOD1(OnPublicResetPacket, void(const QuicPublicResetPacket&)); |
751 | 751 |
752 MOCK_METHOD1(OnVersionNegotiationPacket, | 752 MOCK_METHOD1(OnVersionNegotiationPacket, |
753 void(const QuicVersionNegotiationPacket&)); | 753 void(const QuicVersionNegotiationPacket&)); |
754 | 754 |
755 MOCK_METHOD2(OnRevivedPacket, | 755 MOCK_METHOD2(OnRevivedPacket, |
756 void(const QuicPacketHeader&, StringPiece payload)); | 756 void(const QuicPacketHeader&, StringPiece payload)); |
757 }; | 757 }; |
758 | 758 |
| 759 class MockReceivedPacketManager : public QuicReceivedPacketManager { |
| 760 public: |
| 761 explicit MockReceivedPacketManager(QuicConnectionStats* stats); |
| 762 ~MockReceivedPacketManager() override; |
| 763 |
| 764 MOCK_METHOD3(RecordPacketReceived, |
| 765 void(QuicByteCount bytes, |
| 766 const QuicPacketHeader& header, |
| 767 QuicTime receipt_time)); |
| 768 MOCK_METHOD1(RecordPacketRevived, void(QuicPacketNumber packet_number)); |
| 769 MOCK_METHOD1(IsMissing, bool(QuicPacketNumber packet_number)); |
| 770 MOCK_METHOD1(IsAwaitingPacket, bool(QuicPacketNumber packet_number)); |
| 771 MOCK_METHOD1(UpdatePacketInformationSentByPeer, |
| 772 void(const QuicStopWaitingFrame& stop_waiting)); |
| 773 MOCK_CONST_METHOD0(HasNewMissingPackets, bool(void)); |
| 774 MOCK_CONST_METHOD0(ack_frame_updated, bool(void)); |
| 775 }; |
| 776 |
759 // Creates a client session for testing. | 777 // Creates a client session for testing. |
760 // | 778 // |
761 // server_id: The server id associated with this stream. | 779 // server_id: The server id associated with this stream. |
762 // supports_stateless_rejects: Does this client support stateless rejects. | 780 // supports_stateless_rejects: Does this client support stateless rejects. |
763 // connection_start_time: The time to set for the connection clock. | 781 // connection_start_time: The time to set for the connection clock. |
764 // Needed for strike-register nonce verification. The client | 782 // Needed for strike-register nonce verification. The client |
765 // connection_start_time should be synchronized witht the server | 783 // connection_start_time should be synchronized witht the server |
766 // start time, otherwise nonce verification will fail. | 784 // start time, otherwise nonce verification will fail. |
767 // supported_versions: Set of QUIC versions this client supports. | 785 // supported_versions: Set of QUIC versions this client supports. |
768 // helper: Pointer to the MockConnectionHelper to use for the session. | 786 // helper: Pointer to the MockConnectionHelper to use for the session. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 TestQuicSpdyServerSession** server_session); | 823 TestQuicSpdyServerSession** server_session); |
806 | 824 |
807 // Helper to generate client side stream ids, generalizes | 825 // Helper to generate client side stream ids, generalizes |
808 // kClientDataStreamId1 etc. above. | 826 // kClientDataStreamId1 etc. above. |
809 QuicStreamId QuicClientDataStreamId(int i); | 827 QuicStreamId QuicClientDataStreamId(int i); |
810 | 828 |
811 } // namespace test | 829 } // namespace test |
812 } // namespace net | 830 } // namespace net |
813 | 831 |
814 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 832 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |