| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 MOCK_METHOD0(OnWriteBlocked, void()); | 295 MOCK_METHOD0(OnWriteBlocked, void()); |
| 296 MOCK_METHOD0(OnCanWrite, void()); | 296 MOCK_METHOD0(OnCanWrite, void()); |
| 297 MOCK_METHOD1(OnCongestionWindowChange, void(QuicTime now)); | 297 MOCK_METHOD1(OnCongestionWindowChange, void(QuicTime now)); |
| 298 MOCK_METHOD0(OnConnectionMigration, void()); | 298 MOCK_METHOD0(OnConnectionMigration, void()); |
| 299 MOCK_CONST_METHOD0(WillingAndAbleToWrite, bool()); | 299 MOCK_CONST_METHOD0(WillingAndAbleToWrite, bool()); |
| 300 MOCK_CONST_METHOD0(HasPendingHandshake, bool()); | 300 MOCK_CONST_METHOD0(HasPendingHandshake, bool()); |
| 301 MOCK_CONST_METHOD0(HasOpenDynamicStreams, bool()); | 301 MOCK_CONST_METHOD0(HasOpenDynamicStreams, bool()); |
| 302 MOCK_METHOD1(OnSuccessfulVersionNegotiation, | 302 MOCK_METHOD1(OnSuccessfulVersionNegotiation, |
| 303 void(const QuicVersion& version)); | 303 void(const QuicVersion& version)); |
| 304 MOCK_METHOD0(OnConfigNegotiated, void()); | 304 MOCK_METHOD0(OnConfigNegotiated, void()); |
| 305 MOCK_METHOD0(PostProcessAfterData, void()); |
| 305 | 306 |
| 306 private: | 307 private: |
| 307 DISALLOW_COPY_AND_ASSIGN(MockConnectionVisitor); | 308 DISALLOW_COPY_AND_ASSIGN(MockConnectionVisitor); |
| 308 }; | 309 }; |
| 309 | 310 |
| 310 class MockConnectionHelper : public QuicConnectionHelperInterface { | 311 class MockConnectionHelper : public QuicConnectionHelperInterface { |
| 311 public: | 312 public: |
| 312 MockConnectionHelper(); | 313 MockConnectionHelper(); |
| 313 ~MockConnectionHelper() override; | 314 ~MockConnectionHelper() override; |
| 314 const QuicClock* GetClock() const override; | 315 const QuicClock* GetClock() const override; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 QuicPromisedByUrlMap promised_by_url_; | 555 QuicPromisedByUrlMap promised_by_url_; |
| 555 | 556 |
| 556 DISALLOW_COPY_AND_ASSIGN(TestQuicSpdyClientSession); | 557 DISALLOW_COPY_AND_ASSIGN(TestQuicSpdyClientSession); |
| 557 }; | 558 }; |
| 558 | 559 |
| 559 class MockPacketWriter : public QuicPacketWriter { | 560 class MockPacketWriter : public QuicPacketWriter { |
| 560 public: | 561 public: |
| 561 MockPacketWriter(); | 562 MockPacketWriter(); |
| 562 ~MockPacketWriter() override; | 563 ~MockPacketWriter() override; |
| 563 | 564 |
| 564 MOCK_METHOD4(WritePacket, | 565 MOCK_METHOD5(WritePacket, |
| 565 WriteResult(const char* buffer, | 566 WriteResult(const char* buffer, |
| 566 size_t buf_len, | 567 size_t buf_len, |
| 567 const IPAddressNumber& self_address, | 568 const IPAddressNumber& self_address, |
| 568 const IPEndPoint& peer_address)); | 569 const IPEndPoint& peer_address, |
| 570 PerPacketOptions* options)); |
| 569 MOCK_CONST_METHOD0(IsWriteBlockedDataBuffered, bool()); | 571 MOCK_CONST_METHOD0(IsWriteBlockedDataBuffered, bool()); |
| 570 MOCK_CONST_METHOD0(IsWriteBlocked, bool()); | 572 MOCK_CONST_METHOD0(IsWriteBlocked, bool()); |
| 571 MOCK_METHOD0(SetWritable, void()); | 573 MOCK_METHOD0(SetWritable, void()); |
| 572 MOCK_CONST_METHOD1(GetMaxPacketSize, | 574 MOCK_CONST_METHOD1(GetMaxPacketSize, |
| 573 QuicByteCount(const IPEndPoint& peer_address)); | 575 QuicByteCount(const IPEndPoint& peer_address)); |
| 574 | 576 |
| 575 private: | 577 private: |
| 576 DISALLOW_COPY_AND_ASSIGN(MockPacketWriter); | 578 DISALLOW_COPY_AND_ASSIGN(MockPacketWriter); |
| 577 }; | 579 }; |
| 578 | 580 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 TestQuicSpdyServerSession** server_session); | 813 TestQuicSpdyServerSession** server_session); |
| 812 | 814 |
| 813 // Helper to generate client side stream ids, generalizes | 815 // Helper to generate client side stream ids, generalizes |
| 814 // kClientDataStreamId1 etc. above. | 816 // kClientDataStreamId1 etc. above. |
| 815 QuicStreamId QuicClientDataStreamId(int i); | 817 QuicStreamId QuicClientDataStreamId(int i); |
| 816 | 818 |
| 817 } // namespace test | 819 } // namespace test |
| 818 } // namespace net | 820 } // namespace net |
| 819 | 821 |
| 820 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 822 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |