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

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

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « net/quic/test_tools/mock_clock.cc ('k') | net/quic/test_tools/mock_crypto_client_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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_H_
6 #define NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_H_
7
8 #include <string>
9
10 #include "net/quic/crypto/crypto_handshake.h"
11 #include "net/quic/crypto/crypto_protocol.h"
12 #include "net/quic/quic_crypto_client_stream.h"
13 #include "net/quic/quic_session.h"
14
15 namespace net {
16
17 class QuicServerId;
18
19 class MockCryptoClientStream : public QuicCryptoClientStream {
20 public:
21 // HandshakeMode enumerates the handshake mode MockCryptoClientStream should
22 // mock in CryptoConnect.
23 enum HandshakeMode {
24 // CONFIRM_HANDSHAKE indicates that CryptoConnect will immediately confirm
25 // the handshake and establish encryption. This behavior will never happen
26 // in the field, but is convenient for higher level tests.
27 CONFIRM_HANDSHAKE,
28
29 // ZERO_RTT indicates that CryptoConnect will establish encryption but will
30 // not confirm the handshake.
31 ZERO_RTT,
32
33 // COLD_START indicates that CryptoConnect will neither establish encryption
34 // nor confirm the handshake
35 COLD_START,
36 };
37
38 MockCryptoClientStream(
39 const QuicServerId& server_id,
40 QuicClientSessionBase* session,
41 ProofVerifyContext* verify_context,
42 QuicCryptoClientConfig* crypto_config,
43 HandshakeMode handshake_mode,
44 const ProofVerifyDetails* proof_verify_details_);
45 ~MockCryptoClientStream() override;
46
47 // CryptoFramerVisitorInterface implementation.
48 void OnHandshakeMessage(const CryptoHandshakeMessage& message) override;
49
50 // QuicCryptoClientStream implementation.
51 void CryptoConnect() override;
52
53 // Invokes the sessions's CryptoHandshakeEvent method with the specified
54 // event.
55 void SendOnCryptoHandshakeEvent(QuicSession::CryptoHandshakeEvent event);
56
57 HandshakeMode handshake_mode_;
58
59 private:
60 void SetConfigNegotiated();
61 QuicClientSessionBase* client_session();
62
63 const ProofVerifyDetails* proof_verify_details_;
64
65 DISALLOW_COPY_AND_ASSIGN(MockCryptoClientStream);
66 };
67
68 } // namespace net
69
70 #endif // NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_H_
OLDNEW
« no previous file with comments | « net/quic/test_tools/mock_clock.cc ('k') | net/quic/test_tools/mock_crypto_client_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698