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/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 return ""; | 79 return ""; |
80 } | 80 } |
81 }; | 81 }; |
82 | 82 |
83 class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> { | 83 class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> { |
84 protected: | 84 protected: |
85 QuicClientSessionTest() | 85 QuicClientSessionTest() |
86 : writer_(new TestPacketWriter(GetParam())), | 86 : writer_(new TestPacketWriter(GetParam())), |
87 connection_( | 87 connection_( |
88 new PacketSavingConnection(false, SupportedVersions(GetParam()))), | 88 new PacketSavingConnection(false, SupportedVersions(GetParam()))), |
89 session_(connection_, GetSocket().Pass(), writer_.Pass(), NULL, NULL, | 89 session_(connection_, GetSocket().Pass(), writer_.Pass(), NULL, |
90 make_scoped_ptr((QuicServerInfo*)NULL), | 90 make_scoped_ptr((QuicServerInfo*)NULL), DefaultQuicConfig(), |
91 QuicServerId(kServerHostname, kServerPort, false, | |
92 PRIVACY_MODE_DISABLED), | |
93 DefaultQuicConfig(), &crypto_config_, | |
94 base::MessageLoop::current()->message_loop_proxy().get(), | 91 base::MessageLoop::current()->message_loop_proxy().get(), |
95 &net_log_) { | 92 &net_log_) { |
| 93 session_.InitializeSession(QuicServerId(kServerHostname, kServerPort, false, |
| 94 PRIVACY_MODE_DISABLED), |
| 95 &crypto_config_, NULL); |
96 session_.config()->SetDefaults(); | 96 session_.config()->SetDefaults(); |
97 crypto_config_.SetDefaults(); | 97 crypto_config_.SetDefaults(); |
98 } | 98 } |
99 | 99 |
100 virtual void TearDown() OVERRIDE { | 100 virtual void TearDown() OVERRIDE { |
101 session_.CloseSessionOnError(ERR_ABORTED); | 101 session_.CloseSessionOnError(ERR_ABORTED); |
102 } | 102 } |
103 | 103 |
104 scoped_ptr<DatagramClientSocket> GetSocket() { | 104 scoped_ptr<DatagramClientSocket> GetSocket() { |
105 socket_factory_.AddSocketDataProvider(&socket_data_); | 105 socket_factory_.AddSocketDataProvider(&socket_data_); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 227 |
228 EXPECT_TRUE(session_.CanPool("www.example.org")); | 228 EXPECT_TRUE(session_.CanPool("www.example.org")); |
229 EXPECT_TRUE(session_.CanPool("mail.example.org")); | 229 EXPECT_TRUE(session_.CanPool("mail.example.org")); |
230 EXPECT_FALSE(session_.CanPool("mail.example.com")); | 230 EXPECT_FALSE(session_.CanPool("mail.example.com")); |
231 EXPECT_FALSE(session_.CanPool("mail.google.com")); | 231 EXPECT_FALSE(session_.CanPool("mail.google.com")); |
232 } | 232 } |
233 | 233 |
234 } // namespace | 234 } // namespace |
235 } // namespace test | 235 } // namespace test |
236 } // namespace net | 236 } // namespace net |
OLD | NEW |