| 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_server_session_base.h" | 9 #include "net/quic/core/quic_server_session_base.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 namespace test { | 13 namespace test { |
| 14 | 14 |
| 15 class MockQuicServerSessionVisitor : public QuicServerSessionBase::Visitor { | 15 class MockQuicServerSessionVisitor : public QuicServerSessionBase::Visitor { |
| 16 public: | 16 public: |
| 17 MockQuicServerSessionVisitor(); | 17 MockQuicServerSessionVisitor(); |
| 18 virtual ~MockQuicServerSessionVisitor() override; | 18 virtual ~MockQuicServerSessionVisitor() override; |
| 19 MOCK_METHOD3(OnConnectionClosed, | 19 MOCK_METHOD3(OnConnectionClosed, |
| 20 void(QuicConnectionId connection_id, | 20 void(QuicConnectionId connection_id, |
| 21 QuicErrorCode error, | 21 QuicErrorCode error, |
| 22 const std::string& error_details)); | 22 const std::string& error_details)); |
| 23 MOCK_METHOD1(OnWriteBlocked, | 23 MOCK_METHOD1(OnWriteBlocked, |
| 24 void(QuicBlockedWriterInterface* blocked_writer)); | 24 void(QuicBlockedWriterInterface* blocked_writer)); |
| 25 MOCK_METHOD1(OnConnectionAddedToTimeWaitList, | 25 MOCK_METHOD1(OnConnectionAddedToTimeWaitList, |
| 26 void(QuicConnectionId connection_id)); | 26 void(QuicConnectionId connection_id)); |
| 27 MOCK_METHOD1(OnPacketBeingDispatchedToSession, |
| 28 void(QuicServerSessionBase* session)); |
| 27 | 29 |
| 28 private: | 30 private: |
| 29 DISALLOW_COPY_AND_ASSIGN(MockQuicServerSessionVisitor); | 31 DISALLOW_COPY_AND_ASSIGN(MockQuicServerSessionVisitor); |
| 30 }; | 32 }; |
| 31 | 33 |
| 32 class MockQuicServerSessionHelper : public QuicServerSessionBase::Helper { | 34 class MockQuicServerSessionHelper : public QuicServerSessionBase::Helper { |
| 33 public: | 35 public: |
| 34 MockQuicServerSessionHelper(); | 36 MockQuicServerSessionHelper(); |
| 35 ~MockQuicServerSessionHelper() override; | 37 ~MockQuicServerSessionHelper() override; |
| 36 MOCK_CONST_METHOD1(GenerateConnectionIdForReject, | 38 MOCK_CONST_METHOD1(GenerateConnectionIdForReject, |
| 37 QuicConnectionId(QuicConnectionId connection_id)); | 39 QuicConnectionId(QuicConnectionId connection_id)); |
| 38 MOCK_CONST_METHOD3(CanAcceptClientHello, | 40 MOCK_CONST_METHOD3(CanAcceptClientHello, |
| 39 bool(const CryptoHandshakeMessage& message, | 41 bool(const CryptoHandshakeMessage& message, |
| 40 const IPEndPoint& self_address, | 42 const IPEndPoint& self_address, |
| 41 std::string* error_details)); | 43 std::string* error_details)); |
| 42 | 44 |
| 43 private: | 45 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(MockQuicServerSessionHelper); | 46 DISALLOW_COPY_AND_ASSIGN(MockQuicServerSessionHelper); |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 } // namespace test | 49 } // namespace test |
| 48 } // namespace net | 50 } // namespace net |
| 49 | 51 |
| 50 #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 |