| 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 #include "net/quic/test_tools/mock_crypto_client_stream.h" | 5 #include "net/quic/test_tools/mock_crypto_client_stream.h" |
| 6 #include "net/ssl/ssl_info.h" | 6 #include "net/ssl/ssl_info.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| 11 MockCryptoClientStream::MockCryptoClientStream( | 11 MockCryptoClientStream::MockCryptoClientStream( |
| 12 const string& server_hostname, | 12 const string& server_hostname, |
| 13 uint16 server_port, |
| 13 QuicSession* session, | 14 QuicSession* session, |
| 14 QuicCryptoClientConfig* crypto_config, | 15 QuicCryptoClientConfig* crypto_config, |
| 15 HandshakeMode handshake_mode, | 16 HandshakeMode handshake_mode, |
| 16 const SSLInfo* ssl_info) | 17 const SSLInfo* ssl_info) |
| 17 : QuicCryptoClientStream(server_hostname, session, crypto_config), | 18 : QuicCryptoClientStream(server_hostname, server_port, session, |
| 19 crypto_config), |
| 18 handshake_mode_(handshake_mode), | 20 handshake_mode_(handshake_mode), |
| 19 ssl_info_(ssl_info) { | 21 ssl_info_(ssl_info) { |
| 20 } | 22 } |
| 21 | 23 |
| 22 MockCryptoClientStream::~MockCryptoClientStream() { | 24 MockCryptoClientStream::~MockCryptoClientStream() { |
| 23 } | 25 } |
| 24 | 26 |
| 25 void MockCryptoClientStream::OnHandshakeMessage( | 27 void MockCryptoClientStream::OnHandshakeMessage( |
| 26 const CryptoHandshakeMessage& message) { | 28 const CryptoHandshakeMessage& message) { |
| 27 CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE); | 29 CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 CryptoHandshakeMessage msg; | 90 CryptoHandshakeMessage msg; |
| 89 session()->config()->ToHandshakeMessage(&msg); | 91 session()->config()->ToHandshakeMessage(&msg); |
| 90 string error_details; | 92 string error_details; |
| 91 const QuicErrorCode error = | 93 const QuicErrorCode error = |
| 92 session()->config()->ProcessClientHello(msg, &error_details); | 94 session()->config()->ProcessClientHello(msg, &error_details); |
| 93 ASSERT_EQ(QUIC_NO_ERROR, error); | 95 ASSERT_EQ(QUIC_NO_ERROR, error); |
| 94 ASSERT_TRUE(session()->config()->negotiated()); | 96 ASSERT_TRUE(session()->config()->negotiated()); |
| 95 } | 97 } |
| 96 | 98 |
| 97 } // namespace net | 99 } // namespace net |
| OLD | NEW |