Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Side by Side Diff: net/quic/test_tools/mock_crypto_client_stream_factory.h

Issue 14083012: QUIC: retransmit packets with the correct encryption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: zero rtt test Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ 5 #ifndef NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_
6 #define NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ 6 #define NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "net/quic/quic_crypto_client_stream.h" 10 #include "net/quic/quic_crypto_client_stream.h"
11 #include "net/quic/quic_crypto_client_stream_factory.h" 11 #include "net/quic/quic_crypto_client_stream_factory.h"
12 #include "net/quic/quic_session.h" 12 #include "net/quic/quic_session.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 class MockCryptoClientStreamFactory : public QuicCryptoClientStreamFactory { 16 class MockCryptoClientStreamFactory : public QuicCryptoClientStreamFactory {
17 public: 17 public:
18 // HandshakeMode enumerates the handshake mode MockCryptoClientStream should
Ryan Hamilton 2013/05/01 23:47:32 nit: please move this enum to the mock stream (out
ramant (doing other things) 2013/05/02 00:08:05 Done.
19 // mock in CryptoConnect.
20 enum HandshakeMode {
21 // CONFIRM_HANDSHAKE indicates that during CryptoConnect, we will set
22 // encryption_established_ to true but handshake_confirmed_ to true.
Ryan Hamilton 2013/05/01 23:47:32 // CONFIRM_HANDSHAKE indicates that CryptoConnect
ramant (doing other things) 2013/05/02 00:08:05 Done.
23 CONFIRM_HANDSHAKE,
24
25 // ZERO_RTT indicates that during CryptoConnect, we will set
26 // encryption_established_ to true but handshake_confirmed_ to false.
Ryan Hamilton 2013/05/01 23:47:32 // ZERO_RTT indicates that CryptoConnect will esta
ramant (doing other things) 2013/05/02 00:08:05 Done.
27 ZERO_RTT,
28 };
29
30 MockCryptoClientStreamFactory();
31
18 virtual ~MockCryptoClientStreamFactory() {} 32 virtual ~MockCryptoClientStreamFactory() {}
19 33
20 virtual QuicCryptoClientStream* CreateQuicCryptoClientStream( 34 virtual QuicCryptoClientStream* CreateQuicCryptoClientStream(
21 const string& server_hostname, 35 const string& server_hostname,
22 const QuicConfig& config, 36 const QuicConfig& config,
23 QuicSession* session, 37 QuicSession* session,
24 QuicCryptoClientConfig* crypto_config) OVERRIDE; 38 QuicCryptoClientConfig* crypto_config) OVERRIDE;
39
40 void set_handshake_mode(HandshakeMode handshake_mode) {
41 handshake_mode_ = handshake_mode;
42 }
43
44 private:
45 HandshakeMode handshake_mode_;
25 }; 46 };
26 47
27 } // namespace net 48 } // namespace net
28 49
29 #endif // NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ 50 #endif // NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698