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

Unified Diff: net/quic/quic_received_packet_manager_test.cc

Issue 76723002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation error Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_received_packet_manager.cc ('k') | net/quic/quic_reliable_client_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_received_packet_manager_test.cc
diff --git a/net/quic/quic_received_packet_manager_test.cc b/net/quic/quic_received_packet_manager_test.cc
index 76be470c265c82f9ec75672be3fb1efd12196637..dd7d5290127cef63b60d8db9dcc81a2df665cb9b 100644
--- a/net/quic/quic_received_packet_manager_test.cc
+++ b/net/quic/quic_received_packet_manager_test.cc
@@ -114,6 +114,26 @@ TEST_F(QuicReceivedPacketManagerTest, DontWaitForPacketsBefore) {
EXPECT_TRUE(received_manager_.IsAwaitingPacket(6u));
}
+TEST_F(QuicReceivedPacketManagerTest, UpdateReceivedPacketInfo) {
+ QuicPacketHeader header;
+ header.packet_sequence_number = 2u;
+ QuicTime two_ms = QuicTime::Zero().Add(QuicTime::Delta::FromMilliseconds(2));
+ received_manager_.RecordPacketReceived(header, two_ms);
+
+ ReceivedPacketInfo info;
+ received_manager_.UpdateReceivedPacketInfo(&info, QuicTime::Zero());
+ // When UpdateReceivedPacketInfo with a time earlier than the time of the
+ // largest observed packet, make sure that the delta is 0, not negative.
+ EXPECT_EQ(QuicTime::Delta::Zero(), info.delta_time_largest_observed);
+
+ QuicTime four_ms = QuicTime::Zero().Add(QuicTime::Delta::FromMilliseconds(4));
+ received_manager_.UpdateReceivedPacketInfo(&info, four_ms);
+ // When UpdateReceivedPacketInfo after not having received a new packet,
+ // the delta should still be accurate.
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(2),
+ info.delta_time_largest_observed);
+}
+
} // namespace
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/quic_received_packet_manager.cc ('k') | net/quic/quic_reliable_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698