blob: 0954bb71390b4668ddb19b1a31902f0b54e39fa7 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// 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 teama6ef0a62019-03-07 20:34:33 -05008#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"
dschinazi580d30b2019-04-26 15:05:20 -070010#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050011
12namespace quic {
13namespace test {
14
15class 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,
vasilvvc48c8712019-03-11 13:38:16 -070024 const std::string& error_details,
QUICHE teama6ef0a62019-03-07 20:34:33 -050025 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
34class 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 teama6ef0a62019-03-07 20:34:33 -050042 MOCK_CONST_METHOD5(CanAcceptClientHello,
43 bool(const CryptoHandshakeMessage& message,
44 const QuicSocketAddress& client_address,
45 const QuicSocketAddress& peer_address,
46 const QuicSocketAddress& self_address,
vasilvvc48c8712019-03-11 13:38:16 -070047 std::string* error_details));
QUICHE teama6ef0a62019-03-07 20:34:33 -050048};
49
50} // namespace test
51} // namespace quic
52
53#endif // QUICHE_QUIC_TEST_TOOLS_MOCK_QUIC_SESSION_VISITOR_H_