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/test_tools/crypto_test_utils.h" | 10 #include "net/quic/test_tools/crypto_test_utils.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace test { | 21 namespace test { |
22 namespace { | 22 namespace { |
23 | 23 |
24 const char kServerHostname[] = "www.example.com"; | 24 const char kServerHostname[] = "www.example.com"; |
25 | 25 |
26 class QuicClientSessionTest : public ::testing::Test { | 26 class QuicClientSessionTest : public ::testing::Test { |
27 protected: | 27 protected: |
28 QuicClientSessionTest() | 28 QuicClientSessionTest() |
29 : guid_(1), | 29 : guid_(1), |
30 connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)), | 30 connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)), |
31 session_(kServerHostname, connection_) { | 31 session_(kServerHostname, config_, connection_, &crypto_config_) { |
32 config_.SetDefaults(); | 32 config_.SetDefaults(); |
33 crypto_config_.SetDefaults(); | 33 crypto_config_.SetDefaults(); |
34 } | 34 } |
35 | 35 |
36 void CompleteCryptoHandshake() { | 36 void CompleteCryptoHandshake() { |
37 ASSERT_TRUE(session_.CryptoConnect()); | 37 ASSERT_TRUE(session_.CryptoConnect()); |
38 CryptoTestUtils::HandshakeWithFakeServer( | 38 CryptoTestUtils::HandshakeWithFakeServer( |
39 connection_, session_.GetCryptoStream()); | 39 connection_, session_.GetCryptoStream()); |
40 } | 40 } |
41 | 41 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // After receiving a GoAway, I should no longer be able to create outgoing | 77 // After receiving a GoAway, I should no longer be able to create outgoing |
78 // streams. | 78 // streams. |
79 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); | 79 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); |
80 EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream()); | 80 EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream()); |
81 } | 81 } |
82 | 82 |
83 } // namespace | 83 } // namespace |
84 } // namespace test | 84 } // namespace test |
85 } // namespace tools | 85 } // namespace tools |
86 } // namespace net | 86 } // namespace net |
OLD | NEW |