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

Unified Diff: net/quic/quic_connection_test.cc

Issue 1613513003: Early connection migration in QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Typo fixed. Created 4 years, 11 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
Index: net/quic/quic_connection_test.cc
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index 22676aebf7c1f0671e6e70707ae0dfbc6dc0831d..5eaea3f025f3df489866c9f3ab95f2b65c8b4e1e 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -3485,6 +3485,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, _));
}
@@ -5688,6 +5689,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

Powered by Google App Engine
This is Rietveld 408576698