| OLD | NEW |
| 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_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_H_ |
| 6 #define NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_H_ | 6 #define NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "net/quic/crypto/crypto_handshake.h" | 10 #include "net/quic/crypto/crypto_handshake.h" |
| 11 #include "net/quic/crypto/crypto_protocol.h" | 11 #include "net/quic/crypto/crypto_protocol.h" |
| 12 #include "net/quic/quic_crypto_client_stream.h" | 12 #include "net/quic/quic_crypto_client_stream.h" |
| 13 #include "net/quic/quic_session.h" | 13 #include "net/quic/quic_session.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 class QuicSessionKey; |
| 18 |
| 17 class MockCryptoClientStream : public QuicCryptoClientStream { | 19 class MockCryptoClientStream : public QuicCryptoClientStream { |
| 18 public: | 20 public: |
| 19 // HandshakeMode enumerates the handshake mode MockCryptoClientStream should | 21 // HandshakeMode enumerates the handshake mode MockCryptoClientStream should |
| 20 // mock in CryptoConnect. | 22 // mock in CryptoConnect. |
| 21 enum HandshakeMode { | 23 enum HandshakeMode { |
| 22 // CONFIRM_HANDSHAKE indicates that CryptoConnect will immediately confirm | 24 // CONFIRM_HANDSHAKE indicates that CryptoConnect will immediately confirm |
| 23 // the handshake and establish encryption. This behavior will never happen | 25 // the handshake and establish encryption. This behavior will never happen |
| 24 // in the field, but is convenient for higher level tests. | 26 // in the field, but is convenient for higher level tests. |
| 25 CONFIRM_HANDSHAKE, | 27 CONFIRM_HANDSHAKE, |
| 26 | 28 |
| 27 // ZERO_RTT indicates that CryptoConnect will establish encryption but will | 29 // ZERO_RTT indicates that CryptoConnect will establish encryption but will |
| 28 // not confirm the handshake. | 30 // not confirm the handshake. |
| 29 ZERO_RTT, | 31 ZERO_RTT, |
| 30 | 32 |
| 31 // COLD_START indicates that CryptoConnect will neither establish encryption | 33 // COLD_START indicates that CryptoConnect will neither establish encryption |
| 32 // nor confirm the handshake | 34 // nor confirm the handshake |
| 33 COLD_START, | 35 COLD_START, |
| 34 }; | 36 }; |
| 35 | 37 |
| 36 MockCryptoClientStream( | 38 MockCryptoClientStream( |
| 37 const string& server_hostname, | 39 const QuicSessionKey& session_key, |
| 38 QuicSession* session, | 40 QuicSession* session, |
| 39 QuicCryptoClientConfig* crypto_config, | 41 QuicCryptoClientConfig* crypto_config, |
| 40 HandshakeMode handshake_mode, | 42 HandshakeMode handshake_mode, |
| 41 const SSLInfo* ssl_info); | 43 const SSLInfo* ssl_info); |
| 42 virtual ~MockCryptoClientStream(); | 44 virtual ~MockCryptoClientStream(); |
| 43 | 45 |
| 44 // CryptoFramerVisitorInterface implementation. | 46 // CryptoFramerVisitorInterface implementation. |
| 45 virtual void OnHandshakeMessage( | 47 virtual void OnHandshakeMessage( |
| 46 const CryptoHandshakeMessage& message) OVERRIDE; | 48 const CryptoHandshakeMessage& message) OVERRIDE; |
| 47 | 49 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 58 | 60 |
| 59 private: | 61 private: |
| 60 void SetConfigNegotiated(); | 62 void SetConfigNegotiated(); |
| 61 | 63 |
| 62 const SSLInfo* ssl_info_; | 64 const SSLInfo* ssl_info_; |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 } // namespace net | 67 } // namespace net |
| 66 | 68 |
| 67 #endif // NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_H_ | 69 #endif // NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_H_ |
| OLD | NEW |