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/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "net/base/capturing_net_log.h" |
10 #include "net/base/test_completion_callback.h" | 11 #include "net/base/test_completion_callback.h" |
11 #include "net/quic/crypto/crypto_protocol.h" | 12 #include "net/quic/crypto/crypto_protocol.h" |
12 #include "net/quic/test_tools/quic_test_utils.h" | 13 #include "net/quic/test_tools/quic_test_utils.h" |
13 | 14 |
14 using testing::_; | 15 using testing::_; |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 namespace test { | 18 namespace test { |
18 namespace { | 19 namespace { |
19 | 20 |
20 const char kServerHostname[] = "www.example.com"; | 21 const char kServerHostname[] = "www.example.com"; |
21 | 22 |
22 class QuicClientSessionTest : public ::testing::Test { | 23 class QuicClientSessionTest : public ::testing::Test { |
23 protected: | 24 protected: |
24 QuicClientSessionTest() | 25 QuicClientSessionTest() |
25 : guid_(1), | 26 : guid_(1), |
26 connection_(new PacketSavingConnection(guid_, IPEndPoint())), | 27 connection_(new PacketSavingConnection(guid_, IPEndPoint())), |
27 session_(connection_, NULL, NULL, kServerHostname) { | 28 session_(connection_, NULL, NULL, kServerHostname, NULL) { |
28 } | 29 } |
29 | 30 |
30 QuicGuid guid_; | 31 QuicGuid guid_; |
31 PacketSavingConnection* connection_; | 32 PacketSavingConnection* connection_; |
32 QuicClientSession session_; | 33 QuicClientSession session_; |
33 QuicConnectionVisitorInterface* visitor_; | 34 QuicConnectionVisitorInterface* visitor_; |
34 TestCompletionCallback callback_; | 35 TestCompletionCallback callback_; |
35 }; | 36 }; |
36 | 37 |
37 TEST_F(QuicClientSessionTest, CryptoConnectSendsCorrectData) { | 38 TEST_F(QuicClientSessionTest, CryptoConnectSendsCorrectData) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 EXPECT_FALSE(session_.CreateOutgoingReliableStream()); | 71 EXPECT_FALSE(session_.CreateOutgoingReliableStream()); |
71 | 72 |
72 // Close a stream and ensure I can now open a new one. | 73 // Close a stream and ensure I can now open a new one. |
73 session_.CloseStream(streams[0]->id()); | 74 session_.CloseStream(streams[0]->id()); |
74 EXPECT_TRUE(session_.CreateOutgoingReliableStream()); | 75 EXPECT_TRUE(session_.CreateOutgoingReliableStream()); |
75 } | 76 } |
76 | 77 |
77 } // namespace | 78 } // namespace |
78 } // namespace test | 79 } // namespace test |
79 } // namespace net | 80 } // namespace net |
OLD | NEW |