Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(912)

Side by Side Diff: net/quic/core/quic_connection_test.cc

Issue 2511893003: In case of stateless reject, change quic connection close source from client to server on client si… (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698