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

Unified Diff: net/quic/quic_connection_test.cc

Issue 157803007: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win_x64 compiler error fix Created 6 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_fec_group.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 4e82472d60576474da9ea70a213e205fe2faf955..c1e20f038f6c5420212e24020ee03ade42ace7fc 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -638,7 +638,7 @@ class QuicConnectionTest : public ::testing::TestWithParam<bool> {
}
size_t ProcessFecProtectedPacket(QuicPacketSequenceNumber number,
- bool expect_revival, bool entropy_flag) {
+ bool expect_revival, bool entropy_flag) {
if (expect_revival) {
EXPECT_CALL(visitor_, OnStreamFrames(_)).WillOnce(Return(accept_packet_));
}
@@ -1847,7 +1847,9 @@ TEST_F(QuicConnectionTest, RetransmitWriteBlockedAckedOriginalThenSent) {
ProcessAckPacket(&ack);
connection_.OnPacketSent(WriteResult(WRITE_STATUS_OK, 0));
- EXPECT_TRUE(connection_.GetRetransmissionAlarm()->IsSet());
+ // The retransmission alarm should not be set because there are
+ // no unacked packets.
+ EXPECT_FALSE(connection_.GetRetransmissionAlarm()->IsSet());
}
TEST_F(QuicConnectionTest, ResumptionAlarmWhenWriteBlocked) {
@@ -1983,8 +1985,9 @@ TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacketsThenFecPacket) {
// Don't send missing packet 2.
ProcessFecProtectedPacket(3, false, !kEntropyFlag);
ProcessFecPacket(4, 1, true, kEntropyFlag, NULL);
- // Entropy flag should be true, so entropy should not be 0.
- EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
+ // Ensure QUIC no longer revives entropy for lost packets.
+ EXPECT_EQ(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
+ EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 4));
}
TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacket) {
@@ -2007,8 +2010,9 @@ TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPackets) {
ProcessFecProtectedPacket(3, false, kEntropyFlag);
ProcessFecProtectedPacket(4, false, kEntropyFlag);
ProcessFecProtectedPacket(5, true, !kEntropyFlag);
- // Entropy flag should be true, so entropy should be 0.
- EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
+ // Ensure entropy is not revived for the missing packet.
+ EXPECT_EQ(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
+ EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 3));
}
TEST_F(QuicConnectionTest, RTO) {
@@ -2781,6 +2785,17 @@ TEST_F(QuicConnectionTest, ReceivedEntropyHashCalculation) {
EXPECT_EQ(146u, outgoing_ack()->received_info.entropy_hash);
}
+TEST_F(QuicConnectionTest, ReceivedEntropyHashCalculationHalfFEC) {
+ // FEC packets should not change the entropy hash calculation.
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).WillRepeatedly(Return(true));
+ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
+ ProcessDataPacket(1, 1, kEntropyFlag);
+ ProcessFecPacket(4, 1, false, kEntropyFlag, NULL);
+ ProcessDataPacket(3, 3, !kEntropyFlag);
+ ProcessFecPacket(7, 3, false, kEntropyFlag, NULL);
+ EXPECT_EQ(146u, outgoing_ack()->received_info.entropy_hash);
+}
+
TEST_F(QuicConnectionTest, UpdateEntropyForReceivedPackets) {
EXPECT_CALL(visitor_, OnStreamFrames(_)).WillRepeatedly(Return(true));
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_fec_group.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698