| 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/core/quic_connection.h" | 5 #include "net/quic/core/quic_connection.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 4324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4335 false, false); | 4335 false, false); |
| 4336 } | 4336 } |
| 4337 | 4337 |
| 4338 TEST_P(QuicConnectionTest, PublicReset) { | 4338 TEST_P(QuicConnectionTest, PublicReset) { |
| 4339 QuicPublicResetPacket header; | 4339 QuicPublicResetPacket header; |
| 4340 // Public reset packet in only built by server. | 4340 // Public reset packet in only built by server. |
| 4341 header.public_header.connection_id = | 4341 header.public_header.connection_id = |
| 4342 GetPeerInMemoryConnectionId(connection_id_); | 4342 GetPeerInMemoryConnectionId(connection_id_); |
| 4343 header.public_header.reset_flag = true; | 4343 header.public_header.reset_flag = true; |
| 4344 header.public_header.version_flag = false; | 4344 header.public_header.version_flag = false; |
| 4345 header.rejected_packet_number = 10101; | |
| 4346 std::unique_ptr<QuicEncryptedPacket> packet( | 4345 std::unique_ptr<QuicEncryptedPacket> packet( |
| 4347 framer_.BuildPublicResetPacket(header)); | 4346 framer_.BuildPublicResetPacket(header)); |
| 4348 std::unique_ptr<QuicReceivedPacket> received( | 4347 std::unique_ptr<QuicReceivedPacket> received( |
| 4349 ConstructReceivedPacket(*packet, QuicTime::Zero())); | 4348 ConstructReceivedPacket(*packet, QuicTime::Zero())); |
| 4350 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PUBLIC_RESET, _, | 4349 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PUBLIC_RESET, _, |
| 4351 ConnectionCloseSource::FROM_PEER)); | 4350 ConnectionCloseSource::FROM_PEER)); |
| 4352 connection_.ProcessUdpPacket(kSelfAddress, kPeerAddress, *received); | 4351 connection_.ProcessUdpPacket(kSelfAddress, kPeerAddress, *received); |
| 4353 } | 4352 } |
| 4354 | 4353 |
| 4355 TEST_P(QuicConnectionTest, GoAway) { | 4354 TEST_P(QuicConnectionTest, GoAway) { |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5153 error_details, ConnectionCloseSource::FROM_PEER)); | 5152 error_details, ConnectionCloseSource::FROM_PEER)); |
| 5154 connection_.set_perspective(Perspective::IS_CLIENT); | 5153 connection_.set_perspective(Perspective::IS_CLIENT); |
| 5155 connection_.CloseConnection(QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT, | 5154 connection_.CloseConnection(QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT, |
| 5156 error_details, | 5155 error_details, |
| 5157 ConnectionCloseBehavior::SILENT_CLOSE); | 5156 ConnectionCloseBehavior::SILENT_CLOSE); |
| 5158 } | 5157 } |
| 5159 | 5158 |
| 5160 } // namespace | 5159 } // namespace |
| 5161 } // namespace test | 5160 } // namespace test |
| 5162 } // namespace net | 5161 } // namespace net |
| OLD | NEW |