| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 client_session.config()->SetDefaults(); | 169 client_session.config()->SetDefaults(); |
| 170 crypto_config.SetDefaults(); | 170 crypto_config.SetDefaults(); |
| 171 // TODO(rtenneti): Enable testing of ProofVerifier. | 171 // TODO(rtenneti): Enable testing of ProofVerifier. |
| 172 // if (!options.dont_verify_certs) { | 172 // if (!options.dont_verify_certs) { |
| 173 // crypto_config.SetProofVerifier(ProofVerifierForTesting()); | 173 // crypto_config.SetProofVerifier(ProofVerifierForTesting()); |
| 174 // } | 174 // } |
| 175 if (options.channel_id_enabled) { | 175 if (options.channel_id_enabled) { |
| 176 crypto_config.SetChannelIDSigner(ChannelIDSignerForTesting()); | 176 crypto_config.SetChannelIDSigner(ChannelIDSignerForTesting()); |
| 177 } | 177 } |
| 178 QuicCryptoClientStream client("test.example.com", &client_session, | 178 QuicCryptoClientStream client("test.example.com", 80, &client_session, |
| 179 &crypto_config); | 179 &crypto_config); |
| 180 client_session.SetCryptoStream(&client); | 180 client_session.SetCryptoStream(&client); |
| 181 | 181 |
| 182 CHECK(client.CryptoConnect()); | 182 CHECK(client.CryptoConnect()); |
| 183 CHECK_EQ(1u, client_conn->packets_.size()); | 183 CHECK_EQ(1u, client_conn->packets_.size()); |
| 184 | 184 |
| 185 CommunicateHandshakeMessages(client_conn, &client, server_conn, server); | 185 CommunicateHandshakeMessages(client_conn, &client, server_conn, server); |
| 186 | 186 |
| 187 CompareClientAndServerKeys(&client, server); | 187 CompareClientAndServerKeys(&client, server); |
| 188 | 188 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 scoped_ptr<QuicData> bytes(CryptoFramer::ConstructHandshakeMessage(msg)); | 511 scoped_ptr<QuicData> bytes(CryptoFramer::ConstructHandshakeMessage(msg)); |
| 512 scoped_ptr<CryptoHandshakeMessage> parsed( | 512 scoped_ptr<CryptoHandshakeMessage> parsed( |
| 513 CryptoFramer::ParseMessage(bytes->AsStringPiece())); | 513 CryptoFramer::ParseMessage(bytes->AsStringPiece())); |
| 514 CHECK(parsed.get()); | 514 CHECK(parsed.get()); |
| 515 | 515 |
| 516 return *parsed; | 516 return *parsed; |
| 517 } | 517 } |
| 518 | 518 |
| 519 } // namespace test | 519 } // namespace test |
| 520 } // namespace net | 520 } // namespace net |
| OLD | NEW |