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/tools/quic/quic_client_session.h" | 5 #include "net/tools/quic/quic_client_session.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "net/base/ip_endpoint.h" | 9 #include "net/base/ip_endpoint.h" |
10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" | 10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 const char kServerHostname[] = "www.example.org"; | 36 const char kServerHostname[] = "www.example.org"; |
37 const uint16 kPort = 80; | 37 const uint16 kPort = 80; |
38 | 38 |
39 class ToolsQuicClientSessionTest | 39 class ToolsQuicClientSessionTest |
40 : public ::testing::TestWithParam<QuicVersion> { | 40 : public ::testing::TestWithParam<QuicVersion> { |
41 protected: | 41 protected: |
42 ToolsQuicClientSessionTest() | 42 ToolsQuicClientSessionTest() |
43 : connection_( | 43 : connection_( |
44 new PacketSavingConnection(false, SupportedVersions(GetParam()))) { | 44 new PacketSavingConnection(false, SupportedVersions(GetParam()))) { |
45 session_.reset(new QuicClientSession(DefaultQuicConfig(), connection_)); | 45 session_.reset(new QuicClientSession(DefaultQuicConfig(), connection_, |
| 46 /*is_secure=*/false)); |
46 session_->InitializeSession( | 47 session_->InitializeSession( |
47 QuicServerId(kServerHostname, kPort, false, PRIVACY_MODE_DISABLED), | 48 QuicServerId(kServerHostname, kPort, false, PRIVACY_MODE_DISABLED), |
48 &crypto_config_); | 49 &crypto_config_); |
49 } | 50 } |
50 | 51 |
51 void CompleteCryptoHandshake() { | 52 void CompleteCryptoHandshake() { |
52 ASSERT_TRUE(session_->CryptoConnect()); | 53 ASSERT_TRUE(session_->CryptoConnect()); |
53 CryptoTestUtils::HandshakeWithFakeServer( | 54 CryptoTestUtils::HandshakeWithFakeServer( |
54 connection_, session_->GetCryptoStream()); | 55 connection_, session_->GetCryptoStream()); |
55 } | 56 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Close connection shouldn't be called. | 136 // Close connection shouldn't be called. |
136 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(0); | 137 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(0); |
137 session_->connection()->ProcessUdpPacket(client_address, server_address, | 138 session_->connection()->ProcessUdpPacket(client_address, server_address, |
138 valid_packet); | 139 valid_packet); |
139 } | 140 } |
140 | 141 |
141 } // namespace | 142 } // namespace |
142 } // namespace test | 143 } // namespace test |
143 } // namespace tools | 144 } // namespace tools |
144 } // namespace net | 145 } // namespace net |
OLD | NEW |