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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 new PacketSavingConnection(false, SupportedVersions(GetParam()))) { | 44 new PacketSavingConnection(false, SupportedVersions(GetParam()))) { |
45 session_.reset(new QuicClientSession(DefaultQuicConfig(), connection_)); | 45 session_.reset(new QuicClientSession(DefaultQuicConfig(), connection_)); |
46 session_->InitializeSession( | 46 session_->InitializeSession( |
47 QuicServerId(kServerHostname, kPort, false, PRIVACY_MODE_DISABLED), | 47 QuicServerId(kServerHostname, kPort, false, PRIVACY_MODE_DISABLED), |
48 &crypto_config_); | 48 &crypto_config_); |
49 // Advance the time, because timers do not like uninitialized times. | 49 // Advance the time, because timers do not like uninitialized times. |
50 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); | 50 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); |
51 } | 51 } |
52 | 52 |
53 void CompleteCryptoHandshake() { | 53 void CompleteCryptoHandshake() { |
54 ASSERT_TRUE(session_->CryptoConnect()); | 54 session_->CryptoConnect(); |
55 CryptoTestUtils::HandshakeWithFakeServer( | 55 CryptoTestUtils::HandshakeWithFakeServer( |
56 connection_, session_->GetCryptoStream()); | 56 connection_, session_->GetCryptoStream()); |
57 } | 57 } |
58 | 58 |
59 PacketSavingConnection* connection_; | 59 PacketSavingConnection* connection_; |
60 scoped_ptr<QuicClientSession> session_; | 60 scoped_ptr<QuicClientSession> session_; |
61 QuicCryptoClientConfig crypto_config_; | 61 QuicCryptoClientConfig crypto_config_; |
62 }; | 62 }; |
63 | 63 |
64 INSTANTIATE_TEST_CASE_P(Tests, ToolsQuicClientSessionTest, | 64 INSTANTIATE_TEST_CASE_P(Tests, ToolsQuicClientSessionTest, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // Close connection shouldn't be called. | 137 // Close connection shouldn't be called. |
138 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(0); | 138 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(0); |
139 session_->connection()->ProcessUdpPacket(client_address, server_address, | 139 session_->connection()->ProcessUdpPacket(client_address, server_address, |
140 valid_packet); | 140 valid_packet); |
141 } | 141 } |
142 | 142 |
143 } // namespace | 143 } // namespace |
144 } // namespace test | 144 } // namespace test |
145 } // namespace tools | 145 } // namespace tools |
146 } // namespace net | 146 } // namespace net |
OLD | NEW |