| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 connection_, | 53 connection_, |
| 54 QuicServerId(kServerHostname, kPort, PRIVACY_MODE_DISABLED), | 54 QuicServerId(kServerHostname, kPort, PRIVACY_MODE_DISABLED), |
| 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 CryptoTestUtils::HandshakeWithFakeServer(&helper_, connection_, | 63 QuicCryptoClientStream* stream = |
| 64 session_->GetCryptoStream()); | 64 static_cast<QuicCryptoClientStream*>(session_->GetCryptoStream()); |
| 65 CryptoTestUtils::HandshakeWithFakeServer(&helper_, connection_, stream); |
| 65 } | 66 } |
| 66 | 67 |
| 67 QuicCryptoClientConfig crypto_config_; | 68 QuicCryptoClientConfig crypto_config_; |
| 68 MockHelper helper_; | 69 MockHelper helper_; |
| 69 PacketSavingConnection* connection_; | 70 PacketSavingConnection* connection_; |
| 70 scoped_ptr<QuicClientSession> session_; | 71 scoped_ptr<QuicClientSession> session_; |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 INSTANTIATE_TEST_CASE_P(Tests, ToolsQuicClientSessionTest, | 74 INSTANTIATE_TEST_CASE_P(Tests, ToolsQuicClientSessionTest, |
| 74 ::testing::ValuesIn(QuicSupportedVersions())); | 75 ::testing::ValuesIn(QuicSupportedVersions())); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 PACKET_6BYTE_PACKET_NUMBER, nullptr)); | 217 PACKET_6BYTE_PACKET_NUMBER, nullptr)); |
| 217 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(1); | 218 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(1); |
| 218 session_->connection()->ProcessUdpPacket(client_address, server_address, | 219 session_->connection()->ProcessUdpPacket(client_address, server_address, |
| 219 *packet); | 220 *packet); |
| 220 } | 221 } |
| 221 | 222 |
| 222 } // namespace | 223 } // namespace |
| 223 } // namespace test | 224 } // namespace test |
| 224 } // namespace tools | 225 } // namespace tools |
| 225 } // namespace net | 226 } // namespace net |
| OLD | NEW |