1 // Copyright (c) 2013 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.
5 #ifndef NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_
6 #define NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_
11 #include "net/quic/quic_crypto_client_stream.h"
12 #include "net/quic/quic_crypto_client_stream_factory.h"
13 #include "net/quic/test_tools/mock_crypto_client_stream.h"
19 class MockCryptoClientStreamFactory
: public QuicCryptoClientStreamFactory
{
21 MockCryptoClientStreamFactory();
22 ~MockCryptoClientStreamFactory() override
;
24 QuicCryptoClientStream
* CreateQuicCryptoClientStream(
25 const QuicServerId
& server_id
,
26 QuicChromiumClientSession
* session
,
27 QuicCryptoClientConfig
* crypto_config
) override
;
29 void set_handshake_mode(
30 MockCryptoClientStream::HandshakeMode handshake_mode
) {
31 handshake_mode_
= handshake_mode
;
34 // The caller keeps ownership of |proof_verify_details|.
35 void AddProofVerifyDetails(const ProofVerifyDetails
* proof_verify_details
) {
36 proof_verify_details_queue_
.push(proof_verify_details
);
39 MockCryptoClientStream
* last_stream() const {
44 MockCryptoClientStream::HandshakeMode handshake_mode_
;
45 MockCryptoClientStream
* last_stream_
;
46 std::queue
<const ProofVerifyDetails
*> proof_verify_details_queue_
;
48 DISALLOW_COPY_AND_ASSIGN(MockCryptoClientStreamFactory
);
53 #endif // NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_