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 #include "net/quic/test_tools/mock_crypto_client_stream_factory.h"
7 #include "base/lazy_instance.h"
8 #include "net/quic/quic_chromium_client_session.h"
9 #include "net/quic/quic_crypto_client_stream.h"
10 #include "net/quic/quic_server_id.h"
16 MockCryptoClientStreamFactory::~MockCryptoClientStreamFactory() {
19 MockCryptoClientStreamFactory::MockCryptoClientStreamFactory()
20 : handshake_mode_(MockCryptoClientStream::CONFIRM_HANDSHAKE
),
21 last_stream_(nullptr) {
24 QuicCryptoClientStream
*
25 MockCryptoClientStreamFactory::CreateQuicCryptoClientStream(
26 const QuicServerId
& server_id
,
27 QuicChromiumClientSession
* session
,
28 QuicCryptoClientConfig
* crypto_config
) {
29 const ProofVerifyDetails
* proof_verify_details
= nullptr;
30 if (!proof_verify_details_queue_
.empty()) {
31 proof_verify_details
= proof_verify_details_queue_
.front();
32 proof_verify_details_queue_
.pop();
35 new MockCryptoClientStream(server_id
, session
, nullptr, crypto_config
,
36 handshake_mode_
, proof_verify_details
);