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 QuicSessionKey(kServerHostname, kPort, false, PRIVACY_MODE_DISABLED), |
39 DefaultQuicConfig(), connection_, &crypto_config_)); | 39 DefaultQuicConfig(), connection_, &crypto_config_)); |
40 session_->config()->SetDefaults(); | 40 session_->config()->SetDefaults(); |
41 } | 41 } |
42 | 42 |
43 void CompleteCryptoHandshake() { | 43 void CompleteCryptoHandshake() { |
44 ASSERT_TRUE(session_->CryptoConnect()); | 44 ASSERT_TRUE(session_->CryptoConnect()); |
45 CryptoTestUtils::HandshakeWithFakeServer( | 45 CryptoTestUtils::HandshakeWithFakeServer( |
46 connection_, session_->GetCryptoStream()); | 46 connection_, session_->GetCryptoStream()); |
47 } | 47 } |
48 | 48 |
(...skipping 32 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 | 81 // After receiving a GoAway, I should no longer be able to create outgoing |
82 // streams. | 82 // streams. |
83 session_->OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); | 83 session_->OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); |
84 EXPECT_EQ(NULL, session_->CreateOutgoingDataStream()); | 84 EXPECT_EQ(NULL, session_->CreateOutgoingDataStream()); |
85 } | 85 } |
86 | 86 |
87 } // namespace | 87 } // namespace |
88 } // namespace test | 88 } // namespace test |
89 } // namespace tools | 89 } // namespace tools |
90 } // namespace net | 90 } // namespace net |
OLD | NEW |