| 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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SERVER_SESSION_VISITOR_H_ | 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SERVER_SESSION_VISITOR_H_ |
| 6 #define NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SERVER_SESSION_VISITOR_H_ | 6 #define NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SERVER_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/quic/core/quic_server_session_base.h" | 10 #include "net/quic/core/quic_server_session_base.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 MockQuicServerSessionVisitor : public QuicServerSessionBase::Visitor { | 16 class MockQuicServerSessionVisitor : public QuicServerSessionBase::Visitor { |
| 17 public: | 17 public: |
| 18 MockQuicServerSessionVisitor(); | 18 MockQuicServerSessionVisitor(); |
| 19 virtual ~MockQuicServerSessionVisitor() override; | 19 virtual ~MockQuicServerSessionVisitor() 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(OnConnectionAddedToTimeWaitList, | 26 MOCK_METHOD1(OnConnectionAddedToTimeWaitList, |
| 27 void(QuicConnectionId connection_id)); | 27 void(QuicConnectionId connection_id)); |
| 28 MOCK_METHOD1(OnPacketBeingDispatchedToSession, | 28 MOCK_METHOD1(OnPacketBeingDispatchedToSession, void(QuicSession* session)); |
| 29 void(QuicServerSessionBase* session)); | |
| 30 | 29 |
| 31 private: | 30 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(MockQuicServerSessionVisitor); | 31 DISALLOW_COPY_AND_ASSIGN(MockQuicServerSessionVisitor); |
| 33 }; | 32 }; |
| 34 | 33 |
| 35 class MockQuicCryptoServerStreamHelper : public QuicCryptoServerStream::Helper { | 34 class MockQuicCryptoServerStreamHelper : public QuicCryptoServerStream::Helper { |
| 36 public: | 35 public: |
| 37 MockQuicCryptoServerStreamHelper(); | 36 MockQuicCryptoServerStreamHelper(); |
| 38 ~MockQuicCryptoServerStreamHelper() override; | 37 ~MockQuicCryptoServerStreamHelper() override; |
| 39 MOCK_CONST_METHOD1(GenerateConnectionIdForReject, | 38 MOCK_CONST_METHOD1(GenerateConnectionIdForReject, |
| 40 QuicConnectionId(QuicConnectionId connection_id)); | 39 QuicConnectionId(QuicConnectionId connection_id)); |
| 41 MOCK_CONST_METHOD3(CanAcceptClientHello, | 40 MOCK_CONST_METHOD3(CanAcceptClientHello, |
| 42 bool(const CryptoHandshakeMessage& message, | 41 bool(const CryptoHandshakeMessage& message, |
| 43 const IPEndPoint& self_address, | 42 const IPEndPoint& self_address, |
| 44 std::string* error_details)); | 43 std::string* error_details)); |
| 45 | 44 |
| 46 private: | 45 private: |
| 47 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStreamHelper); | 46 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoServerStreamHelper); |
| 48 }; | 47 }; |
| 49 | 48 |
| 50 } // namespace test | 49 } // namespace test |
| 51 } // namespace net | 50 } // namespace net |
| 52 | 51 |
| 53 #endif // NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SERVER_SESSION_VISITOR_H_ | 52 #endif // NET_TOOLS_QUIC_TEST_TOOLS_MOCK_QUIC_SERVER_SESSION_VISITOR_H_ |
| OLD | NEW |