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/tools/quic/quic_client_session.h" | 5 #include "net/tools/quic/quic_client_session.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "net/base/ip_endpoint.h" | 9 #include "net/base/ip_endpoint.h" |
10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" | 10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 &crypto_config_)) { | 55 &crypto_config_)) { |
56 session_->Initialize(); | 56 session_->Initialize(); |
57 // Advance the time, because timers do not like uninitialized times. | 57 // Advance the time, because timers do not like uninitialized times. |
58 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); | 58 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); |
59 } | 59 } |
60 | 60 |
61 void CompleteCryptoHandshake() { | 61 void CompleteCryptoHandshake() { |
62 session_->CryptoConnect(); | 62 session_->CryptoConnect(); |
63 QuicCryptoClientStream* stream = | 63 QuicCryptoClientStream* stream = |
64 static_cast<QuicCryptoClientStream*>(session_->GetCryptoStream()); | 64 static_cast<QuicCryptoClientStream*>(session_->GetCryptoStream()); |
65 CryptoTestUtils::HandshakeWithFakeServer(&helper_, connection_, stream); | 65 CryptoTestUtils::FakeServerOptions options; |
| 66 CryptoTestUtils::HandshakeWithFakeServer(&helper_, connection_, stream, |
| 67 options); |
66 } | 68 } |
67 | 69 |
68 QuicCryptoClientConfig crypto_config_; | 70 QuicCryptoClientConfig crypto_config_; |
69 MockConnectionHelper helper_; | 71 MockConnectionHelper helper_; |
70 PacketSavingConnection* connection_; | 72 PacketSavingConnection* connection_; |
71 scoped_ptr<QuicClientSession> session_; | 73 scoped_ptr<QuicClientSession> session_; |
72 }; | 74 }; |
73 | 75 |
74 INSTANTIATE_TEST_CASE_P(Tests, ToolsQuicClientSessionTest, | 76 INSTANTIATE_TEST_CASE_P(Tests, ToolsQuicClientSessionTest, |
75 ::testing::ValuesIn(QuicSupportedVersions())); | 77 ::testing::ValuesIn(QuicSupportedVersions())); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 PACKET_6BYTE_PACKET_NUMBER, nullptr)); | 219 PACKET_6BYTE_PACKET_NUMBER, nullptr)); |
218 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(1); | 220 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(1); |
219 session_->connection()->ProcessUdpPacket(client_address, server_address, | 221 session_->connection()->ProcessUdpPacket(client_address, server_address, |
220 *packet); | 222 *packet); |
221 } | 223 } |
222 | 224 |
223 } // namespace | 225 } // namespace |
224 } // namespace test | 226 } // namespace test |
225 } // namespace tools | 227 } // namespace tools |
226 } // namespace net | 228 } // namespace net |
OLD | NEW |