mock_crypto_client_stream_factory.h revision 3551c9c881056c480085172ff9840cab31610854
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. 4 5#ifndef NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ 6#define NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ 7 8#include <string> 9 10#include "net/quic/quic_crypto_client_stream.h" 11#include "net/quic/quic_crypto_client_stream_factory.h" 12#include "net/quic/test_tools/mock_crypto_client_stream.h" 13 14namespace net { 15 16class MockCryptoClientStreamFactory : public QuicCryptoClientStreamFactory { 17 public: 18 MockCryptoClientStreamFactory(); 19 20 virtual ~MockCryptoClientStreamFactory() {} 21 22 virtual QuicCryptoClientStream* CreateQuicCryptoClientStream( 23 const string& server_hostname, 24 QuicSession* session, 25 QuicCryptoClientConfig* crypto_config) OVERRIDE; 26 27 void set_handshake_mode( 28 MockCryptoClientStream::HandshakeMode handshake_mode) { 29 handshake_mode_ = handshake_mode; 30 } 31 32 MockCryptoClientStream* last_stream() const { 33 return last_stream_; 34 } 35 36 private: 37 MockCryptoClientStream::HandshakeMode handshake_mode_; 38 MockCryptoClientStream* last_stream_; 39}; 40 41} // namespace net 42 43#endif // NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ 44