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

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

Issue 2349373002: Only close the QUIC connection after 5RTOs on the client side when the (Closed)
Patch Set: Created 4 years, 3 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 | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_flags_list.h » ('j') | 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 0ce77b23c67e1259e1ee5577a26d4dc4f0424c27..5d6f9e284dd4d261b0fc44b6043da58cd6bca74d 100644
--- a/net/quic/core/quic_connection_test.cc
+++ b/net/quic/core/quic_connection_test.cc
@@ -3554,7 +3554,7 @@ TEST_P(QuicConnectionTest, TimeoutAfterReceiveNotSendWhenUnacked) {
EXPECT_FALSE(connection_.GetTimeoutAlarm()->IsSet());
}
-TEST_P(QuicConnectionTest, TimeoutAfter5RTOs) {
+TEST_P(QuicConnectionTest, TimeoutAfter5ClientRTOs) {
connection_.SetMaxTailLossProbes(kDefaultPathId, 2);
EXPECT_TRUE(connection_.connected());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
@@ -3587,6 +3587,42 @@ TEST_P(QuicConnectionTest, TimeoutAfter5RTOs) {
EXPECT_FALSE(connection_.connected());
}
+TEST_P(QuicConnectionTest, TimeoutAfter5ServerRTOs) {
+ FLAGS_quic_only_5rto_client_side = true;
+ connection_.SetMaxTailLossProbes(kDefaultPathId, 2);
+ QuicConnectionPeer::SetPerspective(&connection_, Perspective::IS_SERVER);
+ QuicFramerPeer::SetPerspective(QuicConnectionPeer::GetFramer(&connection_),
+ Perspective::IS_SERVER);
+ creator_->StopSendingVersion();
+ EXPECT_TRUE(connection_.connected());
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ QuicConfig config;
+ QuicTagVector connection_options;
+ connection_options.push_back(k5RTO);
+ config.SetConnectionOptionsToSend(connection_options);
+ connection_.SetFromConfig(config);
+
+ // Send stream data.
+ SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, kFin, nullptr);
+
+ EXPECT_CALL(visitor_, OnPathDegrading());
+ // Fire the retransmission alarm 6 times, twice for TLP and 4 times for RTO.
+ for (int i = 0; i < 6; ++i) {
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
+ connection_.GetRetransmissionAlarm()->Fire();
+ EXPECT_TRUE(connection_.GetTimeoutAlarm()->IsSet());
+ EXPECT_TRUE(connection_.connected());
+ }
+
+ EXPECT_EQ(2u, connection_.sent_packet_manager().GetConsecutiveTlpCount());
+ EXPECT_EQ(4u, connection_.sent_packet_manager().GetConsecutiveRtoCount());
+ // The 5th RTO should not time out server side.
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
+ connection_.GetRetransmissionAlarm()->Fire();
+ EXPECT_TRUE(connection_.GetTimeoutAlarm()->IsSet());
+ EXPECT_TRUE(connection_.connected());
+}
+
TEST_P(QuicConnectionTest, SendScheduler) {
// Test that if we send a packet without delay, it is not queued.
QuicPacket* packet =
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_flags_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698