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 20 matching lines...) Expand all Loading... |
31 const char kServerHostname[] = "www.example.com"; | 31 const char kServerHostname[] = "www.example.com"; |
32 const uint16 kPort = 80; | 32 const uint16 kPort = 80; |
33 | 33 |
34 class ToolsQuicClientSessionTest | 34 class ToolsQuicClientSessionTest |
35 : public ::testing::TestWithParam<QuicVersion> { | 35 : public ::testing::TestWithParam<QuicVersion> { |
36 protected: | 36 protected: |
37 ToolsQuicClientSessionTest() | 37 ToolsQuicClientSessionTest() |
38 : connection_(new PacketSavingConnection(false, | 38 : connection_(new PacketSavingConnection(false, |
39 SupportedVersions(GetParam()))) { | 39 SupportedVersions(GetParam()))) { |
40 crypto_config_.SetDefaults(); | 40 crypto_config_.SetDefaults(); |
41 session_.reset(new QuicClientSession( | 41 session_.reset(new QuicClientSession(DefaultQuicConfig(), connection_)); |
| 42 session_->InitializeSession( |
42 QuicServerId(kServerHostname, kPort, false, PRIVACY_MODE_DISABLED), | 43 QuicServerId(kServerHostname, kPort, false, PRIVACY_MODE_DISABLED), |
43 DefaultQuicConfig(), | 44 &crypto_config_); |
44 connection_, | |
45 &crypto_config_)); | |
46 session_->config()->SetDefaults(); | 45 session_->config()->SetDefaults(); |
47 } | 46 } |
48 | 47 |
49 void CompleteCryptoHandshake() { | 48 void CompleteCryptoHandshake() { |
50 ASSERT_TRUE(session_->CryptoConnect()); | 49 ASSERT_TRUE(session_->CryptoConnect()); |
51 CryptoTestUtils::HandshakeWithFakeServer( | 50 CryptoTestUtils::HandshakeWithFakeServer( |
52 connection_, session_->GetCryptoStream()); | 51 connection_, session_->GetCryptoStream()); |
53 } | 52 } |
54 | 53 |
55 PacketSavingConnection* connection_; | 54 PacketSavingConnection* connection_; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 QuicSessionPeer::GetHeadersStream(session_.get())->fec_policy()); | 106 QuicSessionPeer::GetHeadersStream(session_.get())->fec_policy()); |
108 QuicSpdyClientStream* stream = session_->CreateOutgoingDataStream(); | 107 QuicSpdyClientStream* stream = session_->CreateOutgoingDataStream(); |
109 ASSERT_TRUE(stream); | 108 ASSERT_TRUE(stream); |
110 EXPECT_EQ(FEC_PROTECT_OPTIONAL, stream->fec_policy()); | 109 EXPECT_EQ(FEC_PROTECT_OPTIONAL, stream->fec_policy()); |
111 } | 110 } |
112 | 111 |
113 } // namespace | 112 } // namespace |
114 } // namespace test | 113 } // namespace test |
115 } // namespace tools | 114 } // namespace tools |
116 } // namespace net | 115 } // namespace net |
OLD | NEW |