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

Unified Diff: net/quic/quic_connection_test.cc

Issue 1665303003: Adds plumbing for QUIC early connection migration. No behavior change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Created 4 years, 10 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/quic_connection.cc ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection_test.cc
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index f06b103d1395f2043bd806199d3fd3f868db1b4d..3b527d8d501de90b7be5481670980ddf4648e70b 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -3373,6 +3373,7 @@ TEST_P(QuicConnectionTest, TestRetransmitOrder) {
clock_.AdvanceTime(QuicTime::Delta::FromSeconds(20));
{
InSequence s;
+ EXPECT_CALL(visitor_, OnPathDegrading());
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, first_packet_size, _));
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, second_packet_size, _));
}
@@ -5510,6 +5511,30 @@ TEST_P(QuicConnectionTest, BadMultipathFlag) {
EXPECT_FALSE(connection_.connected());
}
+TEST_P(QuicConnectionTest, OnPathDegrading) {
+ QuicByteCount packet_size;
+ const size_t kMinTimeoutsBeforePathDegrading = 2;
+
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
+ .WillOnce(DoAll(SaveArg<3>(&packet_size), Return(true)));
+ connection_.SendStreamDataWithString(3, "packet", 0, !kFin, nullptr);
+ for (size_t i = 1; i < kMinTimeoutsBeforePathDegrading; ++i) {
+ clock_.AdvanceTime(QuicTime::Delta::FromSeconds(10 * i));
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, packet_size, _));
+ connection_.GetRetransmissionAlarm()->Fire();
+ }
+ // Next RTO should cause OnPathDegrading to be called before the
+ // retransmission is sent out.
+ clock_.AdvanceTime(
+ QuicTime::Delta::FromSeconds(kMinTimeoutsBeforePathDegrading * 10));
+ {
+ InSequence s;
+ EXPECT_CALL(visitor_, OnPathDegrading());
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, packet_size, _));
+ }
+ connection_.GetRetransmissionAlarm()->Fire();
+}
+
} // namespace
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698