| 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 "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "net/base/capturing_net_log.h" | 10 #include "net/base/capturing_net_log.h" |
| 11 #include "net/base/test_completion_callback.h" | 11 #include "net/base/test_completion_callback.h" |
| 12 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" | 12 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" |
| 13 #include "net/quic/crypto/crypto_protocol.h" | 13 #include "net/quic/crypto/crypto_protocol.h" |
| 14 #include "net/quic/crypto/quic_decrypter.h" | 14 #include "net/quic/crypto/quic_decrypter.h" |
| 15 #include "net/quic/crypto/quic_encrypter.h" | 15 #include "net/quic/crypto/quic_encrypter.h" |
| 16 #include "net/quic/crypto/quic_server_info.h" |
| 16 #include "net/quic/quic_default_packet_writer.h" | 17 #include "net/quic/quic_default_packet_writer.h" |
| 17 #include "net/quic/test_tools/crypto_test_utils.h" | 18 #include "net/quic/test_tools/crypto_test_utils.h" |
| 18 #include "net/quic/test_tools/quic_client_session_peer.h" | 19 #include "net/quic/test_tools/quic_client_session_peer.h" |
| 19 #include "net/quic/test_tools/quic_test_utils.h" | 20 #include "net/quic/test_tools/quic_test_utils.h" |
| 20 #include "net/socket/socket_test_util.h" | 21 #include "net/socket/socket_test_util.h" |
| 21 #include "net/udp/datagram_client_socket.h" | 22 #include "net/udp/datagram_client_socket.h" |
| 22 | 23 |
| 23 using testing::_; | 24 using testing::_; |
| 24 | 25 |
| 25 namespace net { | 26 namespace net { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 private: | 60 private: |
| 60 QuicPacketHeader header_; | 61 QuicPacketHeader header_; |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> { | 64 class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> { |
| 64 protected: | 65 protected: |
| 65 QuicClientSessionTest() | 66 QuicClientSessionTest() |
| 66 : writer_(new TestPacketWriter()), | 67 : writer_(new TestPacketWriter()), |
| 67 connection_( | 68 connection_( |
| 68 new PacketSavingConnection(false, SupportedVersions(GetParam()))), | 69 new PacketSavingConnection(false, SupportedVersions(GetParam()))), |
| 69 session_(connection_, GetSocket().Pass(), writer_.Pass(), NULL, NULL, | 70 session_(connection_, GetSocket().Pass(), writer_.Pass(), NULL, |
| 71 scoped_ptr<QuicServerInfo>((QuicServerInfo*)NULL), NULL, |
| 70 kServerHostname, DefaultQuicConfig(), &crypto_config_, | 72 kServerHostname, DefaultQuicConfig(), &crypto_config_, |
| 71 &net_log_) { | 73 &net_log_) { |
| 72 session_.config()->SetDefaults(); | 74 session_.config()->SetDefaults(); |
| 73 crypto_config_.SetDefaults(); | 75 crypto_config_.SetDefaults(); |
| 74 } | 76 } |
| 75 | 77 |
| 76 virtual void TearDown() OVERRIDE { | 78 virtual void TearDown() OVERRIDE { |
| 77 session_.CloseSessionOnError(ERR_ABORTED); | 79 session_.CloseSessionOnError(ERR_ABORTED); |
| 78 } | 80 } |
| 79 | 81 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 159 |
| 158 // After receiving a GoAway, I should no longer be able to create outgoing | 160 // After receiving a GoAway, I should no longer be able to create outgoing |
| 159 // streams. | 161 // streams. |
| 160 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); | 162 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); |
| 161 EXPECT_EQ(NULL, session_.CreateOutgoingDataStream()); | 163 EXPECT_EQ(NULL, session_.CreateOutgoingDataStream()); |
| 162 } | 164 } |
| 163 | 165 |
| 164 } // namespace | 166 } // namespace |
| 165 } // namespace test | 167 } // namespace test |
| 166 } // namespace net | 168 } // namespace net |
| OLD | NEW |