| 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)); | |
| 27 MOCK_METHOD1(OnConnectionAddedToTimeWaitList, | 26 MOCK_METHOD1(OnConnectionAddedToTimeWaitList, |
| 28 void(QuicConnectionId connection_id)); | 27 void(QuicConnectionId connection_id)); |
| 29 | 28 |
| 30 private: | 29 private: |
| 31 DISALLOW_COPY_AND_ASSIGN(MockQuicSessionVisitor); | 30 DISALLOW_COPY_AND_ASSIGN(MockQuicSessionVisitor); |
| 32 }; | 31 }; |
| 33 | 32 |
| 34 class MockQuicCryptoServerStreamHelper : public QuicCryptoServerStream::Helper { | 33 class MockQuicCryptoServerStreamHelper : public QuicCryptoServerStream::Helper { |
| 35 public: | 34 public: |
| 36 MockQuicCryptoServerStreamHelper(); | 35 MockQuicCryptoServerStreamHelper(); |
| 37 ~MockQuicCryptoServerStreamHelper() override; | 36 ~MockQuicCryptoServerStreamHelper() override; |
| 38 MOCK_CONST_METHOD1(GenerateConnectionIdForReject, | 37 MOCK_CONST_METHOD1(GenerateConnectionIdForReject, |
| 39 QuicConnectionId(QuicConnectionId connection_id)); | 38 QuicConnectionId(QuicConnectionId connection_id)); |
| 40 MOCK_CONST_METHOD3(CanAcceptClientHello, | 39 MOCK_CONST_METHOD3(CanAcceptClientHello, |
| 41 bool(const CryptoHandshakeMessage& message, | 40 bool(const CryptoHandshakeMessage& message, |
| 42 const QuicSocketAddress& self_address, | 41 const QuicSocketAddress& self_address, |
| 43 std::string* error_details)); | 42 std::string* error_details)); |
| 44 | 43 |
| 45 private: | 44 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStreamHelper); | 45 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStreamHelper); |
| 47 }; | 46 }; |
| 48 | 47 |
| 49 } // namespace test | 48 } // namespace test |
| 50 } // namespace net | 49 } // namespace net |
| 51 | 50 |
| 52 #endif // NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ | 51 #endif // NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ |
| OLD | NEW |