| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, false, | 51 session_.InitializeSession(QuicServerId(kServerHostname, kServerPort, false, |
| 52 PRIVACY_MODE_DISABLED), | 52 PRIVACY_MODE_DISABLED), |
| 53 &crypto_config_, nullptr); | 53 &crypto_config_, nullptr); |
| 54 } | 54 } |
| 55 | 55 |
| 56 virtual void TearDown() override { | 56 void TearDown() override { session_.CloseSessionOnError(ERR_ABORTED); } |
| 57 session_.CloseSessionOnError(ERR_ABORTED); | |
| 58 } | |
| 59 | 57 |
| 60 scoped_ptr<DatagramClientSocket> GetSocket() { | 58 scoped_ptr<DatagramClientSocket> GetSocket() { |
| 61 socket_factory_.AddSocketDataProvider(&socket_data_); | 59 socket_factory_.AddSocketDataProvider(&socket_data_); |
| 62 return socket_factory_.CreateDatagramClientSocket( | 60 return socket_factory_.CreateDatagramClientSocket( |
| 63 DatagramSocket::DEFAULT_BIND, base::Bind(&base::RandInt), | 61 DatagramSocket::DEFAULT_BIND, base::Bind(&base::RandInt), |
| 64 &net_log_, NetLog::Source()); | 62 &net_log_, NetLog::Source()); |
| 65 } | 63 } |
| 66 | 64 |
| 67 void CompleteCryptoHandshake() { | 65 void CompleteCryptoHandshake() { |
| 68 ASSERT_EQ(ERR_IO_PENDING, | 66 ASSERT_EQ(ERR_IO_PENDING, |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 session_.OnProofVerifyDetailsAvailable(details); | 222 session_.OnProofVerifyDetailsAvailable(details); |
| 225 CompleteCryptoHandshake(); | 223 CompleteCryptoHandshake(); |
| 226 QuicClientSessionPeer::SetChannelIDSent(&session_, true); | 224 QuicClientSessionPeer::SetChannelIDSent(&session_, true); |
| 227 | 225 |
| 228 EXPECT_TRUE(session_.CanPool("mail.example.org")); | 226 EXPECT_TRUE(session_.CanPool("mail.example.org")); |
| 229 } | 227 } |
| 230 | 228 |
| 231 } // namespace | 229 } // namespace |
| 232 } // namespace test | 230 } // namespace test |
| 233 } // namespace net | 231 } // namespace net |
| OLD | NEW |