| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ | 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ |
| 6 #define NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ | 6 #define NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "net/quic/core/quic_crypto_server_stream.h" | 9 #include "net/quic/core/quic_crypto_server_stream.h" |
| 10 #include "net/tools/quic/quic_time_wait_list_manager.h" | 10 #include "net/tools/quic/quic_time_wait_list_manager.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 namespace test { | 14 namespace test { |
| 15 | 15 |
| 16 class MockQuicSessionVisitor : public QuicTimeWaitListManager::Visitor { | 16 class MockQuicSessionVisitor : public QuicTimeWaitListManager::Visitor { |
| 17 public: | 17 public: |
| 18 MockQuicSessionVisitor(); | 18 MockQuicSessionVisitor(); |
| 19 ~MockQuicSessionVisitor() override; | 19 ~MockQuicSessionVisitor() override; |
| 20 MOCK_METHOD3(OnConnectionClosed, | 20 MOCK_METHOD3(OnConnectionClosed, |
| 21 void(QuicConnectionId connection_id, | 21 void(QuicConnectionId connection_id, |
| 22 QuicErrorCode error, | 22 QuicErrorCode error, |
| 23 const std::string& error_details)); | 23 const std::string& error_details)); |
| 24 MOCK_METHOD1(OnWriteBlocked, | 24 MOCK_METHOD1(OnWriteBlocked, |
| 25 void(QuicBlockedWriterInterface* blocked_writer)); | 25 void(QuicBlockedWriterInterface* blocked_writer)); |
| 26 MOCK_METHOD1(OnRstStreamReceived, void(const QuicRstStreamFrame& frame)); |
| 26 MOCK_METHOD1(OnConnectionAddedToTimeWaitList, | 27 MOCK_METHOD1(OnConnectionAddedToTimeWaitList, |
| 27 void(QuicConnectionId connection_id)); | 28 void(QuicConnectionId connection_id)); |
| 28 | 29 |
| 29 private: | 30 private: |
| 30 DISALLOW_COPY_AND_ASSIGN(MockQuicSessionVisitor); | 31 DISALLOW_COPY_AND_ASSIGN(MockQuicSessionVisitor); |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 class MockQuicCryptoServerStreamHelper : public QuicCryptoServerStream::Helper { | 34 class MockQuicCryptoServerStreamHelper : public QuicCryptoServerStream::Helper { |
| 34 public: | 35 public: |
| 35 MockQuicCryptoServerStreamHelper(); | 36 MockQuicCryptoServerStreamHelper(); |
| 36 ~MockQuicCryptoServerStreamHelper() override; | 37 ~MockQuicCryptoServerStreamHelper() override; |
| 37 MOCK_CONST_METHOD1(GenerateConnectionIdForReject, | 38 MOCK_CONST_METHOD1(GenerateConnectionIdForReject, |
| 38 QuicConnectionId(QuicConnectionId connection_id)); | 39 QuicConnectionId(QuicConnectionId connection_id)); |
| 39 MOCK_CONST_METHOD3(CanAcceptClientHello, | 40 MOCK_CONST_METHOD3(CanAcceptClientHello, |
| 40 bool(const CryptoHandshakeMessage& message, | 41 bool(const CryptoHandshakeMessage& message, |
| 41 const QuicSocketAddress& self_address, | 42 const QuicSocketAddress& self_address, |
| 42 std::string* error_details)); | 43 std::string* error_details)); |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStreamHelper); | 46 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStreamHelper); |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace test | 49 } // namespace test |
| 49 } // namespace net | 50 } // namespace net |
| 50 | 51 |
| 51 #endif // NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ | 52 #endif // NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ |
| OLD | NEW |