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 25 matching lines...) Expand all Loading... |
36 namespace { | 36 namespace { |
37 | 37 |
38 const char kServerHostname[] = "www.example.org"; | 38 const char kServerHostname[] = "www.example.org"; |
39 const uint16 kServerPort = 80; | 39 const uint16 kServerPort = 80; |
40 | 40 |
41 class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> { | 41 class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> { |
42 protected: | 42 protected: |
43 QuicClientSessionTest() | 43 QuicClientSessionTest() |
44 : connection_( | 44 : connection_( |
45 new PacketSavingConnection(false, SupportedVersions(GetParam()))), | 45 new PacketSavingConnection(false, SupportedVersions(GetParam()))), |
46 session_(connection_, GetSocket().Pass(), nullptr, | 46 session_(connection_, |
| 47 GetSocket().Pass(), |
| 48 nullptr, |
47 &transport_security_state_, | 49 &transport_security_state_, |
48 make_scoped_ptr((QuicServerInfo*)nullptr), DefaultQuicConfig(), | 50 make_scoped_ptr((QuicServerInfo*)nullptr), |
| 51 DefaultQuicConfig(), |
| 52 &network_connection_, |
49 base::MessageLoop::current()->message_loop_proxy().get(), | 53 base::MessageLoop::current()->message_loop_proxy().get(), |
50 &net_log_) { | 54 &net_log_) { |
51 session_.InitializeSession(QuicServerId(kServerHostname, kServerPort, | 55 session_.InitializeSession(QuicServerId(kServerHostname, kServerPort, |
52 /*is_secure=*/false, | 56 /*is_secure=*/false, |
53 PRIVACY_MODE_DISABLED), | 57 PRIVACY_MODE_DISABLED), |
54 &crypto_config_, nullptr); | 58 &crypto_config_, nullptr); |
55 // Advance the time, because timers do not like uninitialized times. | 59 // Advance the time, because timers do not like uninitialized times. |
56 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); | 60 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); |
57 } | 61 } |
58 | 62 |
(...skipping 18 matching lines...) Expand all Loading... |
77 CapturingNetLog net_log_; | 81 CapturingNetLog net_log_; |
78 MockClientSocketFactory socket_factory_; | 82 MockClientSocketFactory socket_factory_; |
79 StaticSocketDataProvider socket_data_; | 83 StaticSocketDataProvider socket_data_; |
80 TransportSecurityState transport_security_state_; | 84 TransportSecurityState transport_security_state_; |
81 QuicClientSession session_; | 85 QuicClientSession session_; |
82 MockClock clock_; | 86 MockClock clock_; |
83 MockRandom random_; | 87 MockRandom random_; |
84 QuicConnectionVisitorInterface* visitor_; | 88 QuicConnectionVisitorInterface* visitor_; |
85 TestCompletionCallback callback_; | 89 TestCompletionCallback callback_; |
86 QuicCryptoClientConfig crypto_config_; | 90 QuicCryptoClientConfig crypto_config_; |
| 91 NetworkConnection network_connection_; |
87 }; | 92 }; |
88 | 93 |
89 INSTANTIATE_TEST_CASE_P(Tests, QuicClientSessionTest, | 94 INSTANTIATE_TEST_CASE_P(Tests, QuicClientSessionTest, |
90 ::testing::ValuesIn(QuicSupportedVersions())); | 95 ::testing::ValuesIn(QuicSupportedVersions())); |
91 | 96 |
92 TEST_P(QuicClientSessionTest, CryptoConnect) { | 97 TEST_P(QuicClientSessionTest, CryptoConnect) { |
93 CompleteCryptoHandshake(); | 98 CompleteCryptoHandshake(); |
94 } | 99 } |
95 | 100 |
96 TEST_P(QuicClientSessionTest, MaxNumStreams) { | 101 TEST_P(QuicClientSessionTest, MaxNumStreams) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 session_.OnProofVerifyDetailsAvailable(details); | 230 session_.OnProofVerifyDetailsAvailable(details); |
226 CompleteCryptoHandshake(); | 231 CompleteCryptoHandshake(); |
227 QuicClientSessionPeer::SetChannelIDSent(&session_, true); | 232 QuicClientSessionPeer::SetChannelIDSent(&session_, true); |
228 | 233 |
229 EXPECT_TRUE(session_.CanPool("mail.example.org", PRIVACY_MODE_DISABLED)); | 234 EXPECT_TRUE(session_.CanPool("mail.example.org", PRIVACY_MODE_DISABLED)); |
230 } | 235 } |
231 | 236 |
232 } // namespace | 237 } // namespace |
233 } // namespace test | 238 } // namespace test |
234 } // namespace net | 239 } // namespace net |
OLD | NEW |