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 17 matching lines...) Expand all Loading... |
28 const uint16 kPort = 80; | 28 const uint16 kPort = 80; |
29 | 29 |
30 class ToolsQuicClientSessionTest | 30 class ToolsQuicClientSessionTest |
31 : public ::testing::TestWithParam<QuicVersion> { | 31 : public ::testing::TestWithParam<QuicVersion> { |
32 protected: | 32 protected: |
33 ToolsQuicClientSessionTest() | 33 ToolsQuicClientSessionTest() |
34 : connection_(new PacketSavingConnection(false, | 34 : connection_(new PacketSavingConnection(false, |
35 SupportedVersions(GetParam()))) { | 35 SupportedVersions(GetParam()))) { |
36 crypto_config_.SetDefaults(); | 36 crypto_config_.SetDefaults(); |
37 session_.reset(new QuicClientSession( | 37 session_.reset(new QuicClientSession( |
38 QuicSessionKey(kServerHostname, kPort, false, kPrivacyModeDisabled), | 38 QuicServerId(kServerHostname, kPort, false, kPrivacyModeDisabled), |
39 DefaultQuicConfig(), connection_, &crypto_config_)); | 39 DefaultQuicConfig(), |
| 40 connection_, |
| 41 &crypto_config_)); |
40 session_->config()->SetDefaults(); | 42 session_->config()->SetDefaults(); |
41 } | 43 } |
42 | 44 |
43 void CompleteCryptoHandshake() { | 45 void CompleteCryptoHandshake() { |
44 ASSERT_TRUE(session_->CryptoConnect()); | 46 ASSERT_TRUE(session_->CryptoConnect()); |
45 CryptoTestUtils::HandshakeWithFakeServer( | 47 CryptoTestUtils::HandshakeWithFakeServer( |
46 connection_, session_->GetCryptoStream()); | 48 connection_, session_->GetCryptoStream()); |
47 } | 49 } |
48 | 50 |
49 PacketSavingConnection* connection_; | 51 PacketSavingConnection* connection_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // After receiving a GoAway, I should no longer be able to create outgoing | 83 // After receiving a GoAway, I should no longer be able to create outgoing |
82 // streams. | 84 // streams. |
83 session_->OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); | 85 session_->OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); |
84 EXPECT_EQ(NULL, session_->CreateOutgoingDataStream()); | 86 EXPECT_EQ(NULL, session_->CreateOutgoingDataStream()); |
85 } | 87 } |
86 | 88 |
87 } // namespace | 89 } // namespace |
88 } // namespace test | 90 } // namespace test |
89 } // namespace tools | 91 } // namespace tools |
90 } // namespace net | 92 } // namespace net |
OLD | NEW |