| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/quic_crypto_server_stream.h" | 5 #include "net/quic/quic_crypto_server_stream.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 server_conn->AdvanceTime(QuicTime::Delta::FromSeconds(100000)); | 139 server_conn->AdvanceTime(QuicTime::Delta::FromSeconds(100000)); |
| 140 | 140 |
| 141 QuicConfig client_config; | 141 QuicConfig client_config; |
| 142 client_config.SetDefaults(); | 142 client_config.SetDefaults(); |
| 143 scoped_ptr<TestClientSession> client_session( | 143 scoped_ptr<TestClientSession> client_session( |
| 144 new TestClientSession(client_conn, client_config)); | 144 new TestClientSession(client_conn, client_config)); |
| 145 QuicCryptoClientConfig client_crypto_config; | 145 QuicCryptoClientConfig client_crypto_config; |
| 146 client_crypto_config.SetDefaults(); | 146 client_crypto_config.SetDefaults(); |
| 147 | 147 |
| 148 QuicSessionKey server_key(kServerHostname, kServerPort, false, | 148 QuicSessionKey server_key(kServerHostname, kServerPort, false, |
| 149 kPrivacyModeDisabled); | 149 PRIVACY_MODE_DISABLED); |
| 150 scoped_ptr<QuicCryptoClientStream> client(new QuicCryptoClientStream( | 150 scoped_ptr<QuicCryptoClientStream> client(new QuicCryptoClientStream( |
| 151 server_key, client_session.get(), NULL, &client_crypto_config)); | 151 server_key, client_session.get(), NULL, &client_crypto_config)); |
| 152 client_session->SetCryptoStream(client.get()); | 152 client_session->SetCryptoStream(client.get()); |
| 153 | 153 |
| 154 // Do a first handshake in order to prime the client config with the server's | 154 // Do a first handshake in order to prime the client config with the server's |
| 155 // information. | 155 // information. |
| 156 CHECK(client->CryptoConnect()); | 156 CHECK(client->CryptoConnect()); |
| 157 CHECK_EQ(1u, client_conn->packets_.size()); | 157 CHECK_EQ(1u, client_conn->packets_.size()); |
| 158 | 158 |
| 159 scoped_ptr<TestClientSession> server_session( | 159 scoped_ptr<TestClientSession> server_session( |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // CompleteCryptoHandshake verifies | 259 // CompleteCryptoHandshake verifies |
| 260 // stream_.crypto_negotiated_params().channel_id is correct. | 260 // stream_.crypto_negotiated_params().channel_id is correct. |
| 261 EXPECT_EQ(2, CompleteCryptoHandshake()); | 261 EXPECT_EQ(2, CompleteCryptoHandshake()); |
| 262 EXPECT_TRUE(stream_.encryption_established()); | 262 EXPECT_TRUE(stream_.encryption_established()); |
| 263 EXPECT_TRUE(stream_.handshake_confirmed()); | 263 EXPECT_TRUE(stream_.handshake_confirmed()); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace | 266 } // namespace |
| 267 } // namespace test | 267 } // namespace test |
| 268 } // namespace net | 268 } // namespace net |
| OLD | NEW |