| 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 QuicRstStreamErrorCode error, | 312 QuicRstStreamErrorCode error, |
| 313 QuicStreamOffset bytes_written)); | 313 QuicStreamOffset bytes_written)); |
| 314 MOCK_METHOD3(SendGoAway, void(QuicErrorCode error, | 314 MOCK_METHOD3(SendGoAway, void(QuicErrorCode error, |
| 315 QuicStreamId last_good_stream_id, | 315 QuicStreamId last_good_stream_id, |
| 316 const string& reason)); | 316 const string& reason)); |
| 317 MOCK_METHOD1(SendBlocked, void(QuicStreamId id)); | 317 MOCK_METHOD1(SendBlocked, void(QuicStreamId id)); |
| 318 MOCK_METHOD2(SendWindowUpdate, void(QuicStreamId id, | 318 MOCK_METHOD2(SendWindowUpdate, void(QuicStreamId id, |
| 319 QuicStreamOffset byte_offset)); | 319 QuicStreamOffset byte_offset)); |
| 320 MOCK_METHOD0(OnCanWrite, void()); | 320 MOCK_METHOD0(OnCanWrite, void()); |
| 321 | 321 |
| 322 MOCK_METHOD1(ResumeConnectionState, bool(const CachedNetworkParameters&)); |
| 323 |
| 322 void ProcessUdpPacketInternal(const IPEndPoint& self_address, | 324 void ProcessUdpPacketInternal(const IPEndPoint& self_address, |
| 323 const IPEndPoint& peer_address, | 325 const IPEndPoint& peer_address, |
| 324 const QuicEncryptedPacket& packet) { | 326 const QuicEncryptedPacket& packet) { |
| 325 QuicConnection::ProcessUdpPacket(self_address, peer_address, packet); | 327 QuicConnection::ProcessUdpPacket(self_address, peer_address, packet); |
| 326 } | 328 } |
| 327 | 329 |
| 328 bool OnProtocolVersionMismatch(QuicVersion version) override { | 330 bool OnProtocolVersionMismatch(QuicVersion version) override { |
| 329 return false; | 331 return false; |
| 330 } | 332 } |
| 331 | 333 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 MOCK_CONST_METHOD0(PacingRate, QuicBandwidth(void)); | 478 MOCK_CONST_METHOD0(PacingRate, QuicBandwidth(void)); |
| 477 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void)); | 479 MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void)); |
| 478 MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool()); | 480 MOCK_CONST_METHOD0(HasReliableBandwidthEstimate, bool()); |
| 479 MOCK_METHOD1(OnRttUpdated, void(QuicPacketSequenceNumber)); | 481 MOCK_METHOD1(OnRttUpdated, void(QuicPacketSequenceNumber)); |
| 480 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void)); | 482 MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void)); |
| 481 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount()); | 483 MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount()); |
| 482 MOCK_CONST_METHOD0(InSlowStart, bool()); | 484 MOCK_CONST_METHOD0(InSlowStart, bool()); |
| 483 MOCK_CONST_METHOD0(InRecovery, bool()); | 485 MOCK_CONST_METHOD0(InRecovery, bool()); |
| 484 MOCK_CONST_METHOD0(GetSlowStartThreshold, QuicByteCount()); | 486 MOCK_CONST_METHOD0(GetSlowStartThreshold, QuicByteCount()); |
| 485 MOCK_CONST_METHOD0(GetCongestionControlType, CongestionControlType()); | 487 MOCK_CONST_METHOD0(GetCongestionControlType, CongestionControlType()); |
| 486 MOCK_METHOD1(ResumeConnectionState, void(const CachedNetworkParameters&)); | 488 MOCK_METHOD1(ResumeConnectionState, bool(const CachedNetworkParameters&)); |
| 487 | 489 |
| 488 private: | 490 private: |
| 489 DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm); | 491 DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm); |
| 490 }; | 492 }; |
| 491 | 493 |
| 492 class MockLossAlgorithm : public LossDetectionInterface { | 494 class MockLossAlgorithm : public LossDetectionInterface { |
| 493 public: | 495 public: |
| 494 MockLossAlgorithm(); | 496 MockLossAlgorithm(); |
| 495 ~MockLossAlgorithm() override; | 497 ~MockLossAlgorithm() override; |
| 496 | 498 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 // clears the pointer to it to prevent use-after-free. | 600 // clears the pointer to it to prevent use-after-free. |
| 599 void Unregister(PerConnectionPacketWriter* writer); | 601 void Unregister(PerConnectionPacketWriter* writer); |
| 600 | 602 |
| 601 PerConnectionPacketWriter* current_writer_; | 603 PerConnectionPacketWriter* current_writer_; |
| 602 }; | 604 }; |
| 603 | 605 |
| 604 } // namespace test | 606 } // namespace test |
| 605 } // namespace net | 607 } // namespace net |
| 606 | 608 |
| 607 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 609 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |