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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 | 892 |
893 MOCK_METHOD1(OnVersionNegotiationPacket, | 893 MOCK_METHOD1(OnVersionNegotiationPacket, |
894 void(const QuicVersionNegotiationPacket&)); | 894 void(const QuicVersionNegotiationPacket&)); |
895 }; | 895 }; |
896 | 896 |
897 class MockReceivedPacketManager : public QuicReceivedPacketManager { | 897 class MockReceivedPacketManager : public QuicReceivedPacketManager { |
898 public: | 898 public: |
899 explicit MockReceivedPacketManager(QuicConnectionStats* stats); | 899 explicit MockReceivedPacketManager(QuicConnectionStats* stats); |
900 ~MockReceivedPacketManager() override; | 900 ~MockReceivedPacketManager() override; |
901 | 901 |
902 MOCK_METHOD3(RecordPacketReceived, | 902 MOCK_METHOD2(RecordPacketReceived, |
903 void(QuicByteCount bytes, | 903 void(const QuicPacketHeader& header, QuicTime receipt_time)); |
904 const QuicPacketHeader& header, | |
905 QuicTime receipt_time)); | |
906 MOCK_METHOD1(IsMissing, bool(QuicPacketNumber packet_number)); | 904 MOCK_METHOD1(IsMissing, bool(QuicPacketNumber packet_number)); |
907 MOCK_METHOD1(IsAwaitingPacket, bool(QuicPacketNumber packet_number)); | 905 MOCK_METHOD1(IsAwaitingPacket, bool(QuicPacketNumber packet_number)); |
908 MOCK_METHOD1(UpdatePacketInformationSentByPeer, | 906 MOCK_METHOD1(UpdatePacketInformationSentByPeer, |
909 void(const QuicStopWaitingFrame& stop_waiting)); | 907 void(const QuicStopWaitingFrame& stop_waiting)); |
910 MOCK_CONST_METHOD0(HasNewMissingPackets, bool(void)); | 908 MOCK_CONST_METHOD0(HasNewMissingPackets, bool(void)); |
911 MOCK_CONST_METHOD0(ack_frame_updated, bool(void)); | 909 MOCK_CONST_METHOD0(ack_frame_updated, bool(void)); |
912 }; | 910 }; |
913 | 911 |
914 class MockSentPacketManager : public QuicSentPacketManagerInterface { | 912 class MockSentPacketManager : public QuicSentPacketManagerInterface { |
915 public: | 913 public: |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 T absolute_margin = expected * relative_margin; | 1043 T absolute_margin = expected * relative_margin; |
1046 | 1044 |
1047 EXPECT_GE(expected + absolute_margin, actual); | 1045 EXPECT_GE(expected + absolute_margin, actual); |
1048 EXPECT_LE(expected - absolute_margin, actual); | 1046 EXPECT_LE(expected - absolute_margin, actual); |
1049 } | 1047 } |
1050 | 1048 |
1051 } // namespace test | 1049 } // namespace test |
1052 } // namespace net | 1050 } // namespace net |
1053 | 1051 |
1054 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 1052 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |