Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1137)

Side by Side Diff: net/quic/test_tools/quic_test_utils.h

Issue 2391103003: Landing Recent QUIC changes until 3:24 PM, Oct 01, 2016 UTC-4 (Closed)
Patch Set: Add new error code to quic_error_mapping.cc Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/test_tools/quic_crypto_server_config_peer.cc ('k') | net/tools/quic/chlo_extractor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 MOCK_METHOD1(OnRetransmissionTimeout, void(bool)); 749 MOCK_METHOD1(OnRetransmissionTimeout, void(bool));
750 MOCK_METHOD0(OnConnectionMigration, void()); 750 MOCK_METHOD0(OnConnectionMigration, void());
751 MOCK_METHOD0(RevertRetransmissionTimeout, void()); 751 MOCK_METHOD0(RevertRetransmissionTimeout, void());
752 MOCK_CONST_METHOD2(TimeUntilSend, 752 MOCK_CONST_METHOD2(TimeUntilSend,
753 QuicTime::Delta(QuicTime now, 753 QuicTime::Delta(QuicTime now,
754 QuicByteCount bytes_in_flight)); 754 QuicByteCount bytes_in_flight));
755 MOCK_CONST_METHOD1(PacingRate, QuicBandwidth(QuicByteCount)); 755 MOCK_CONST_METHOD1(PacingRate, QuicBandwidth(QuicByteCount));
756 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void)); 756 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void));
757 MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool()); 757 MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool());
758 MOCK_METHOD1(OnRttUpdated, void(QuicPacketNumber)); 758 MOCK_METHOD1(OnRttUpdated, void(QuicPacketNumber));
759 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void));
760 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount()); 759 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount());
761 MOCK_CONST_METHOD0(GetDebugState, std::string()); 760 MOCK_CONST_METHOD0(GetDebugState, std::string());
762 MOCK_CONST_METHOD0(InSlowStart, bool()); 761 MOCK_CONST_METHOD0(InSlowStart, bool());
763 MOCK_CONST_METHOD0(InRecovery, bool()); 762 MOCK_CONST_METHOD0(InRecovery, bool());
764 MOCK_CONST_METHOD0(GetSlowStartThreshold, QuicByteCount()); 763 MOCK_CONST_METHOD0(GetSlowStartThreshold, QuicByteCount());
765 MOCK_CONST_METHOD0(GetCongestionControlType, CongestionControlType()); 764 MOCK_CONST_METHOD0(GetCongestionControlType, CongestionControlType());
766 MOCK_METHOD2(ResumeConnectionState, 765 MOCK_METHOD2(ResumeConnectionState,
767 void(const CachedNetworkParameters&, bool)); 766 void(const CachedNetworkParameters&, bool));
768 MOCK_METHOD1(OnApplicationLimited, void(QuicByteCount)); 767 MOCK_METHOD1(OnApplicationLimited, void(QuicByteCount));
769 768
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 892
894 MOCK_METHOD1(OnVersionNegotiationPacket, 893 MOCK_METHOD1(OnVersionNegotiationPacket,
895 void(const QuicVersionNegotiationPacket&)); 894 void(const QuicVersionNegotiationPacket&));
896 }; 895 };
897 896
898 class MockReceivedPacketManager : public QuicReceivedPacketManager { 897 class MockReceivedPacketManager : public QuicReceivedPacketManager {
899 public: 898 public:
900 explicit MockReceivedPacketManager(QuicConnectionStats* stats); 899 explicit MockReceivedPacketManager(QuicConnectionStats* stats);
901 ~MockReceivedPacketManager() override; 900 ~MockReceivedPacketManager() override;
902 901
903 MOCK_METHOD3(RecordPacketReceived, 902 MOCK_METHOD2(RecordPacketReceived,
904 void(QuicByteCount bytes, 903 void(const QuicPacketHeader& header, QuicTime receipt_time));
905 const QuicPacketHeader& header,
906 QuicTime receipt_time));
907 MOCK_METHOD1(IsMissing, bool(QuicPacketNumber packet_number)); 904 MOCK_METHOD1(IsMissing, bool(QuicPacketNumber packet_number));
908 MOCK_METHOD1(IsAwaitingPacket, bool(QuicPacketNumber packet_number)); 905 MOCK_METHOD1(IsAwaitingPacket, bool(QuicPacketNumber packet_number));
909 MOCK_METHOD1(UpdatePacketInformationSentByPeer, 906 MOCK_METHOD1(UpdatePacketInformationSentByPeer,
910 void(const QuicStopWaitingFrame& stop_waiting)); 907 void(const QuicStopWaitingFrame& stop_waiting));
911 MOCK_CONST_METHOD0(HasNewMissingPackets, bool(void)); 908 MOCK_CONST_METHOD0(HasNewMissingPackets, bool(void));
912 MOCK_CONST_METHOD0(ack_frame_updated, bool(void)); 909 MOCK_CONST_METHOD0(ack_frame_updated, bool(void));
913 }; 910 };
914 911
915 class MockSentPacketManager : public QuicSentPacketManagerInterface { 912 class MockSentPacketManager : public QuicSentPacketManagerInterface {
916 public: 913 public:
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 T absolute_margin = expected * relative_margin; 1043 T absolute_margin = expected * relative_margin;
1047 1044
1048 EXPECT_GE(expected + absolute_margin, actual); 1045 EXPECT_GE(expected + absolute_margin, actual);
1049 EXPECT_LE(expected - absolute_margin, actual); 1046 EXPECT_LE(expected - absolute_margin, actual);
1050 } 1047 }
1051 1048
1052 } // namespace test 1049 } // namespace test
1053 } // namespace net 1050 } // namespace net
1054 1051
1055 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ 1052 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_crypto_server_config_peer.cc ('k') | net/tools/quic/chlo_extractor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698