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

Unified Diff: net/quic/core/quic_connection_test.cc

Issue 2403173002: Add a test to QuicConnectionTest to ensure the ack bundled with a new CHLO includes the packet numb… (Closed)
Patch Set: Merge branch '42_cl_134981046' into 40_cl_135004450 Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_connection_test.cc
diff --git a/net/quic/core/quic_connection_test.cc b/net/quic/core/quic_connection_test.cc
index 1e99229e9c6f2db42a38a86a78283e8d501b16eb..b3d1be9312dfe8a2819d8f96933641b7a26f3a10 100644
--- a/net/quic/core/quic_connection_test.cc
+++ b/net/quic/core/quic_connection_test.cc
@@ -4236,6 +4236,30 @@ TEST_P(QuicConnectionTest, BundleAckForSecondCHLO) {
EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
}
+TEST_P(QuicConnectionTest, BundleAckForSecondCHLOTwoPacketReject) {
+ FLAGS_quic_receive_packet_once_decrypted = true;
+ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
+ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
+
+ // Process two packets from the crypto stream, which is frame1_'s default,
+ // simulating a 2 packet reject.
+ {
+ ProcessPacket(kDefaultPathId, 1);
+ // Send the new CHLO when the REJ is processed.
+ EXPECT_CALL(visitor_, OnStreamFrame(_))
+ .WillOnce(IgnoreResult(InvokeWithoutArgs(
+ &connection_, &TestConnection::SendCryptoStreamData)));
+ ProcessDataPacket(kDefaultPathId, 2, kEntropyFlag);
+ }
+ // Check that ack is sent and that delayed ack alarm is reset.
+ EXPECT_EQ(3u, writer_->frame_count());
+ EXPECT_FALSE(writer_->stop_waiting_frames().empty());
+ EXPECT_EQ(1u, writer_->stream_frames().size());
+ EXPECT_FALSE(writer_->ack_frames().empty());
+ EXPECT_EQ(2u, writer_->ack_frames().front().largest_observed);
+ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
+}
+
TEST_P(QuicConnectionTest, BundleAckWithDataOnIncomingAck) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, !kFin,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698