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 5299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5310 // Simulate data packet causes write error. | 5310 // Simulate data packet causes write error. |
5311 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PACKET_WRITE_ERROR, _, _)); | 5311 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PACKET_WRITE_ERROR, _, _)); |
5312 SimulateNextPacketTooLarge(); | 5312 SimulateNextPacketTooLarge(); |
5313 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr); | 5313 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr); |
5314 EXPECT_EQ(1u, writer_->frame_count()); | 5314 EXPECT_EQ(1u, writer_->frame_count()); |
5315 EXPECT_FALSE(writer_->connection_close_frames().empty()); | 5315 EXPECT_FALSE(writer_->connection_close_frames().empty()); |
5316 // Ack frame is not bundled in connection close packet. | 5316 // Ack frame is not bundled in connection close packet. |
5317 EXPECT_TRUE(writer_->ack_frames().empty()); | 5317 EXPECT_TRUE(writer_->ack_frames().empty()); |
5318 } | 5318 } |
5319 | 5319 |
| 5320 TEST_P(QuicConnectionTest, CloseConnectionForStatelessReject) { |
| 5321 string error_details("stateless reject"); |
| 5322 EXPECT_CALL(visitor_, OnConnectionClosed( |
| 5323 QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT, |
| 5324 error_details, ConnectionCloseSource::FROM_PEER)); |
| 5325 connection_.set_perspective(Perspective::IS_CLIENT); |
| 5326 connection_.CloseConnection(QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT, |
| 5327 error_details, |
| 5328 ConnectionCloseBehavior::SILENT_CLOSE); |
| 5329 } |
| 5330 |
5320 } // namespace | 5331 } // namespace |
5321 } // namespace test | 5332 } // namespace test |
5322 } // namespace net | 5333 } // namespace net |
OLD | NEW |