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/quic_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 new PacketSavingConnection(false, SupportedVersions(GetParam()))), | 45 new PacketSavingConnection(false, SupportedVersions(GetParam()))), |
46 session_(connection_, GetSocket().Pass(), nullptr, | 46 session_(connection_, GetSocket().Pass(), nullptr, |
47 &transport_security_state_, | 47 &transport_security_state_, |
48 make_scoped_ptr((QuicServerInfo*)nullptr), DefaultQuicConfig(), | 48 make_scoped_ptr((QuicServerInfo*)nullptr), DefaultQuicConfig(), |
49 base::MessageLoop::current()->message_loop_proxy().get(), | 49 base::MessageLoop::current()->message_loop_proxy().get(), |
50 &net_log_) { | 50 &net_log_) { |
51 session_.InitializeSession(QuicServerId(kServerHostname, kServerPort, | 51 session_.InitializeSession(QuicServerId(kServerHostname, kServerPort, |
52 /*is_secure=*/false, | 52 /*is_secure=*/false, |
53 PRIVACY_MODE_DISABLED), | 53 PRIVACY_MODE_DISABLED), |
54 &crypto_config_, nullptr); | 54 &crypto_config_, nullptr); |
| 55 // Advance the time, because timers do not like uninitialized times. |
| 56 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); |
55 } | 57 } |
56 | 58 |
57 void TearDown() override { session_.CloseSessionOnError(ERR_ABORTED); } | 59 void TearDown() override { session_.CloseSessionOnError(ERR_ABORTED); } |
58 | 60 |
59 scoped_ptr<DatagramClientSocket> GetSocket() { | 61 scoped_ptr<DatagramClientSocket> GetSocket() { |
60 socket_factory_.AddSocketDataProvider(&socket_data_); | 62 socket_factory_.AddSocketDataProvider(&socket_data_); |
61 return socket_factory_.CreateDatagramClientSocket( | 63 return socket_factory_.CreateDatagramClientSocket( |
62 DatagramSocket::DEFAULT_BIND, base::Bind(&base::RandInt), | 64 DatagramSocket::DEFAULT_BIND, base::Bind(&base::RandInt), |
63 &net_log_, NetLog::Source()); | 65 &net_log_, NetLog::Source()); |
64 } | 66 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 session_.OnProofVerifyDetailsAvailable(details); | 225 session_.OnProofVerifyDetailsAvailable(details); |
224 CompleteCryptoHandshake(); | 226 CompleteCryptoHandshake(); |
225 QuicClientSessionPeer::SetChannelIDSent(&session_, true); | 227 QuicClientSessionPeer::SetChannelIDSent(&session_, true); |
226 | 228 |
227 EXPECT_TRUE(session_.CanPool("mail.example.org")); | 229 EXPECT_TRUE(session_.CanPool("mail.example.org")); |
228 } | 230 } |
229 | 231 |
230 } // namespace | 232 } // namespace |
231 } // namespace test | 233 } // namespace test |
232 } // namespace net | 234 } // namespace net |
OLD | NEW |