Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / net / quic / test_tools / mock_crypto_client_stream_factory.h
blob6ccc4208ba07b0c1ecd914fac8e6cb995fc45bc0
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_
8 #include <queue>
9 #include <string>
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"
15 namespace net {
17 class QuicServerId;
19 class MockCryptoClientStreamFactory : public QuicCryptoClientStreamFactory {
20 public:
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 {
40 return last_stream_;
43 private:
44 MockCryptoClientStream::HandshakeMode handshake_mode_;
45 MockCryptoClientStream* last_stream_;
46 std::queue<const ProofVerifyDetails*> proof_verify_details_queue_;
48 DISALLOW_COPY_AND_ASSIGN(MockCryptoClientStreamFactory);
51 } // namespace net
53 #endif // NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_