| 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/test_tools/crypto_test_utils.h" | 5 #include "net/quic/test_tools/crypto_test_utils.h" |
| 6 | 6 |
| 7 #include "net/quic/crypto/channel_id.h" | 7 #include "net/quic/crypto/channel_id.h" |
| 8 #include "net/quic/crypto/common_cert_set.h" | 8 #include "net/quic/crypto/common_cert_set.h" |
| 9 #include "net/quic/crypto/crypto_handshake.h" | 9 #include "net/quic/crypto/crypto_handshake.h" |
| 10 #include "net/quic/crypto/quic_crypto_server_config.h" | 10 #include "net/quic/crypto/quic_crypto_server_config.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 ChannelIDSource* source = ChannelIDSourceForTesting(); | 221 ChannelIDSource* source = ChannelIDSourceForTesting(); |
| 222 if (options.channel_id_source_async) { | 222 if (options.channel_id_source_async) { |
| 223 async_channel_id_source = new AsyncTestChannelIDSource(source); | 223 async_channel_id_source = new AsyncTestChannelIDSource(source); |
| 224 source = async_channel_id_source; | 224 source = async_channel_id_source; |
| 225 } | 225 } |
| 226 crypto_config.SetChannelIDSource(source); | 226 crypto_config.SetChannelIDSource(source); |
| 227 } | 227 } |
| 228 QuicServerId server_id(kServerHostname, kServerPort, is_https, | 228 QuicServerId server_id(kServerHostname, kServerPort, is_https, |
| 229 PRIVACY_MODE_DISABLED); | 229 PRIVACY_MODE_DISABLED); |
| 230 if (!options.dont_verify_certs) { | 230 if (!options.dont_verify_certs) { |
| 231 // TODO(wtc): replace this with ProofVerifierForTesting() when we have | 231 crypto_config.SetProofVerifier(ProofVerifierForTesting()); |
| 232 // a working ProofSourceForTesting(). | |
| 233 crypto_config.SetProofVerifier(FakeProofVerifierForTesting()); | |
| 234 } | 232 } |
| 235 TestQuicSpdyClientSession client_session(client_conn, DefaultQuicConfig(), | 233 TestQuicSpdyClientSession client_session(client_conn, DefaultQuicConfig(), |
| 236 server_id, &crypto_config); | 234 server_id, &crypto_config); |
| 237 | 235 |
| 238 client_session.GetCryptoStream()->CryptoConnect(); | 236 client_session.GetCryptoStream()->CryptoConnect(); |
| 239 CHECK_EQ(1u, client_conn->encrypted_packets_.size()); | 237 CHECK_EQ(1u, client_conn->encrypted_packets_.size()); |
| 240 | 238 |
| 241 CommunicateHandshakeMessagesAndRunCallbacks( | 239 CommunicateHandshakeMessagesAndRunCallbacks( |
| 242 client_conn, client_session.GetCryptoStream(), server_conn, server, | 240 client_conn, client_session.GetCryptoStream(), server_conn, server, |
| 243 async_channel_id_source); | 241 async_channel_id_source); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 scoped_ptr<QuicData> bytes(CryptoFramer::ConstructHandshakeMessage(msg)); | 620 scoped_ptr<QuicData> bytes(CryptoFramer::ConstructHandshakeMessage(msg)); |
| 623 scoped_ptr<CryptoHandshakeMessage> parsed( | 621 scoped_ptr<CryptoHandshakeMessage> parsed( |
| 624 CryptoFramer::ParseMessage(bytes->AsStringPiece())); | 622 CryptoFramer::ParseMessage(bytes->AsStringPiece())); |
| 625 CHECK(parsed.get()); | 623 CHECK(parsed.get()); |
| 626 | 624 |
| 627 return *parsed; | 625 return *parsed; |
| 628 } | 626 } |
| 629 | 627 |
| 630 } // namespace test | 628 } // namespace test |
| 631 } // namespace net | 629 } // namespace net |
| OLD | NEW |