| 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/quic/quic_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "net/base/capturing_net_log.h" | 9 #include "net/base/capturing_net_log.h" |
| 10 #include "net/base/test_completion_callback.h" | 10 #include "net/base/test_completion_callback.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 const char kServerHostname[] = "www.example.com"; | 25 const char kServerHostname[] = "www.example.com"; |
| 26 | 26 |
| 27 class QuicClientSessionTest : public ::testing::Test { | 27 class QuicClientSessionTest : public ::testing::Test { |
| 28 protected: | 28 protected: |
| 29 QuicClientSessionTest() | 29 QuicClientSessionTest() |
| 30 : guid_(1), | 30 : guid_(1), |
| 31 connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)), | 31 connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)), |
| 32 session_(connection_, NULL, NULL, NULL, kServerHostname, | 32 session_(connection_, NULL, NULL, NULL, kServerHostname, |
| 33 QuicConfig(), &crypto_config_, &net_log_) { | 33 DefaultQuicConfig(), &crypto_config_, &net_log_) { |
| 34 session_.config()->SetDefaults(); | 34 session_.config()->SetDefaults(); |
| 35 crypto_config_.SetDefaults(); | 35 crypto_config_.SetDefaults(); |
| 36 QuicClientSessionPeer::SetMaxOpenStreams(&session_, 1, 1); | 36 QuicClientSessionPeer::SetMaxOpenStreams(&session_, 1, 1); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void CompleteCryptoHandshake() { | 39 void CompleteCryptoHandshake() { |
| 40 ASSERT_EQ(ERR_IO_PENDING, | 40 ASSERT_EQ(ERR_IO_PENDING, |
| 41 session_.CryptoConnect(callback_.callback())); | 41 session_.CryptoConnect(callback_.callback())); |
| 42 CryptoTestUtils::HandshakeWithFakeServer( | 42 CryptoTestUtils::HandshakeWithFakeServer( |
| 43 connection_, session_.GetCryptoStream()); | 43 connection_, session_.GetCryptoStream()); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 // After receiving a GoAway, I should no longer be able to create outgoing | 96 // After receiving a GoAway, I should no longer be able to create outgoing |
| 97 // streams. | 97 // streams. |
| 98 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); | 98 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); |
| 99 EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream()); | 99 EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream()); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace | 102 } // namespace |
| 103 } // namespace test | 103 } // namespace test |
| 104 } // namespace net | 104 } // namespace net |
| OLD | NEW |