QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ |
| 6 | #define QUICHE_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ |
| 7 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 8 | #include "net/third_party/quiche/src/quic/core/quic_crypto_server_stream.h" |
| 9 | #include "net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.h" |
dschinazi | 580d30b | 2019-04-26 15:05:20 -0700 | [diff] [blame] | 10 | #include "net/third_party/quiche/src/quic/platform/api/quic_test.h" |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 11 | |
| 12 | namespace quic { |
| 13 | namespace test { |
| 14 | |
| 15 | class MockQuicSessionVisitor : public QuicTimeWaitListManager::Visitor { |
| 16 | public: |
| 17 | MockQuicSessionVisitor(); |
| 18 | MockQuicSessionVisitor(const MockQuicSessionVisitor&) = delete; |
| 19 | MockQuicSessionVisitor& operator=(const MockQuicSessionVisitor&) = delete; |
| 20 | ~MockQuicSessionVisitor() override; |
| 21 | MOCK_METHOD4(OnConnectionClosed, |
| 22 | void(QuicConnectionId connection_id, |
| 23 | QuicErrorCode error, |
vasilvv | c48c871 | 2019-03-11 13:38:16 -0700 | [diff] [blame] | 24 | const std::string& error_details, |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 25 | ConnectionCloseSource source)); |
| 26 | MOCK_METHOD1(OnWriteBlocked, |
| 27 | void(QuicBlockedWriterInterface* blocked_writer)); |
| 28 | MOCK_METHOD1(OnRstStreamReceived, void(const QuicRstStreamFrame& frame)); |
| 29 | MOCK_METHOD1(OnStopSendingReceived, void(const QuicStopSendingFrame& frame)); |
| 30 | MOCK_METHOD1(OnConnectionAddedToTimeWaitList, |
| 31 | void(QuicConnectionId connection_id)); |
| 32 | }; |
| 33 | |
| 34 | class MockQuicCryptoServerStreamHelper : public QuicCryptoServerStream::Helper { |
| 35 | public: |
| 36 | MockQuicCryptoServerStreamHelper(); |
| 37 | MockQuicCryptoServerStreamHelper(const MockQuicCryptoServerStreamHelper&) = |
| 38 | delete; |
| 39 | MockQuicCryptoServerStreamHelper& operator=( |
| 40 | const MockQuicCryptoServerStreamHelper&) = delete; |
| 41 | ~MockQuicCryptoServerStreamHelper() override; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 42 | MOCK_CONST_METHOD5(CanAcceptClientHello, |
| 43 | bool(const CryptoHandshakeMessage& message, |
| 44 | const QuicSocketAddress& client_address, |
| 45 | const QuicSocketAddress& peer_address, |
| 46 | const QuicSocketAddress& self_address, |
vasilvv | c48c871 | 2019-03-11 13:38:16 -0700 | [diff] [blame] | 47 | std::string* error_details)); |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | } // namespace test |
| 51 | } // namespace quic |
| 52 | |
| 53 | #endif // QUICHE_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_ |