| 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_chromium_client_session.h" | 5 #include "net/quic/quic_chromium_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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 scoped_ptr<DatagramClientSocket> GetSocket() { | 84 scoped_ptr<DatagramClientSocket> GetSocket() { |
| 85 socket_factory_.AddSocketDataProvider(&socket_data_); | 85 socket_factory_.AddSocketDataProvider(&socket_data_); |
| 86 return socket_factory_.CreateDatagramClientSocket( | 86 return socket_factory_.CreateDatagramClientSocket( |
| 87 DatagramSocket::DEFAULT_BIND, base::Bind(&base::RandInt), &net_log_, | 87 DatagramSocket::DEFAULT_BIND, base::Bind(&base::RandInt), &net_log_, |
| 88 NetLog::Source()); | 88 NetLog::Source()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void CompleteCryptoHandshake() { | 91 void CompleteCryptoHandshake() { |
| 92 ASSERT_EQ(ERR_IO_PENDING, | 92 ASSERT_EQ(ERR_IO_PENDING, |
| 93 session_.CryptoConnect(false, callback_.callback())); | 93 session_.CryptoConnect(false, callback_.callback())); |
| 94 CryptoTestUtils::HandshakeWithFakeServer(&helper_, connection_, | 94 CryptoTestUtils::FakeServerOptions server_options; |
| 95 session_.GetCryptoStream()); | 95 CryptoTestUtils::HandshakeWithFakeServer( |
| 96 &helper_, connection_, session_.GetCryptoStream(), server_options); |
| 96 ASSERT_EQ(OK, callback_.WaitForResult()); | 97 ASSERT_EQ(OK, callback_.WaitForResult()); |
| 97 } | 98 } |
| 98 | 99 |
| 99 MockConnectionHelper helper_; | 100 MockConnectionHelper helper_; |
| 100 QuicCryptoClientConfig crypto_config_; | 101 QuicCryptoClientConfig crypto_config_; |
| 101 PacketSavingConnection* connection_; | 102 PacketSavingConnection* connection_; |
| 102 TestNetLog net_log_; | 103 TestNetLog net_log_; |
| 103 MockClientSocketFactory socket_factory_; | 104 MockClientSocketFactory socket_factory_; |
| 104 StaticSocketDataProvider socket_data_; | 105 StaticSocketDataProvider socket_data_; |
| 105 TransportSecurityState transport_security_state_; | 106 TransportSecurityState transport_security_state_; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 session_.OnProofVerifyDetailsAvailable(details); | 266 session_.OnProofVerifyDetailsAvailable(details); |
| 266 QuicChromiumClientSessionPeer::SetHostname(&session_, "www.example.org"); | 267 QuicChromiumClientSessionPeer::SetHostname(&session_, "www.example.org"); |
| 267 QuicChromiumClientSessionPeer::SetChannelIDSent(&session_, true); | 268 QuicChromiumClientSessionPeer::SetChannelIDSent(&session_, true); |
| 268 | 269 |
| 269 EXPECT_TRUE(session_.CanPool("mail.example.org", PRIVACY_MODE_DISABLED)); | 270 EXPECT_TRUE(session_.CanPool("mail.example.org", PRIVACY_MODE_DISABLED)); |
| 270 } | 271 } |
| 271 | 272 |
| 272 } // namespace | 273 } // namespace |
| 273 } // namespace test | 274 } // namespace test |
| 274 } // namespace net | 275 } // namespace net |
| OLD | NEW |