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

Unified Diff: net/quic/quic_connection_test.cc

Issue 424003002: Inline the members of QUIC's ReceivedPacketInfo into QuicAckFrame now (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_FixRate_congestion_type_71746617
Patch Set: Created 6 years, 5 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_logger.cc ('k') | net/quic/quic_framer.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 9f79abc03f5e98c30000b3ab54d3d783cf932bb5..b8720709ce213e67fa515477c6b07e78c1a5fe9a 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -826,7 +826,7 @@ class QuicConnectionTest : public ::testing::TestWithParam<QuicVersion> {
}
bool IsMissing(QuicPacketSequenceNumber number) {
- return IsAwaitingPacket(outgoing_ack()->received_info, number);
+ return IsAwaitingPacket(*outgoing_ack(), number);
}
QuicPacket* ConstructDataPacket(QuicPacketSequenceNumber number,
@@ -892,8 +892,9 @@ class QuicConnectionTest : public ::testing::TestWithParam<QuicVersion> {
const QuicAckFrame InitAckFrame(QuicPacketSequenceNumber largest_observed) {
QuicAckFrame frame(MakeAckFrame(largest_observed));
if (largest_observed > 0) {
- frame.received_info.entropy_hash =
- QuicConnectionPeer::GetSentEntropyHash(&connection_, largest_observed);
+ frame.entropy_hash =
+ QuicConnectionPeer::GetSentEntropyHash(&connection_,
+ largest_observed);
}
return frame;
}
@@ -906,24 +907,24 @@ class QuicConnectionTest : public ::testing::TestWithParam<QuicVersion> {
}
// Explicitly nack a packet.
void NackPacket(QuicPacketSequenceNumber missing, QuicAckFrame* frame) {
- frame->received_info.missing_packets.insert(missing);
- frame->received_info.entropy_hash ^=
- QuicConnectionPeer::GetSentEntropyHash(&connection_, missing);
+ frame->missing_packets.insert(missing);
+ frame->entropy_hash ^=
+ QuicConnectionPeer::GetSentEntropyHash(&connection_, missing);
if (missing > 1) {
- frame->received_info.entropy_hash ^=
- QuicConnectionPeer::GetSentEntropyHash(&connection_, missing - 1);
+ frame->entropy_hash ^=
+ QuicConnectionPeer::GetSentEntropyHash(&connection_, missing - 1);
}
}
// Undo nacking a packet within the frame.
void AckPacket(QuicPacketSequenceNumber arrived, QuicAckFrame* frame) {
- EXPECT_THAT(frame->received_info.missing_packets, Contains(arrived));
- frame->received_info.missing_packets.erase(arrived);
- frame->received_info.entropy_hash ^=
- QuicConnectionPeer::GetSentEntropyHash(&connection_, arrived);
+ EXPECT_THAT(frame->missing_packets, Contains(arrived));
+ frame->missing_packets.erase(arrived);
+ frame->entropy_hash ^=
+ QuicConnectionPeer::GetSentEntropyHash(&connection_, arrived);
if (arrived > 1) {
- frame->received_info.entropy_hash ^=
- QuicConnectionPeer::GetSentEntropyHash(&connection_, arrived - 1);
+ frame->entropy_hash ^=
+ QuicConnectionPeer::GetSentEntropyHash(&connection_, arrived - 1);
}
}
@@ -991,33 +992,33 @@ TEST_P(QuicConnectionTest, PacketsInOrder) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessPacket(1);
- EXPECT_EQ(1u, outgoing_ack()->received_info.largest_observed);
- EXPECT_EQ(0u, outgoing_ack()->received_info.missing_packets.size());
+ EXPECT_EQ(1u, outgoing_ack()->largest_observed);
+ EXPECT_EQ(0u, outgoing_ack()->missing_packets.size());
ProcessPacket(2);
- EXPECT_EQ(2u, outgoing_ack()->received_info.largest_observed);
- EXPECT_EQ(0u, outgoing_ack()->received_info.missing_packets.size());
+ EXPECT_EQ(2u, outgoing_ack()->largest_observed);
+ EXPECT_EQ(0u, outgoing_ack()->missing_packets.size());
ProcessPacket(3);
- EXPECT_EQ(3u, outgoing_ack()->received_info.largest_observed);
- EXPECT_EQ(0u, outgoing_ack()->received_info.missing_packets.size());
+ EXPECT_EQ(3u, outgoing_ack()->largest_observed);
+ EXPECT_EQ(0u, outgoing_ack()->missing_packets.size());
}
TEST_P(QuicConnectionTest, PacketsOutOfOrder) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessPacket(3);
- EXPECT_EQ(3u, outgoing_ack()->received_info.largest_observed);
+ EXPECT_EQ(3u, outgoing_ack()->largest_observed);
EXPECT_TRUE(IsMissing(2));
EXPECT_TRUE(IsMissing(1));
ProcessPacket(2);
- EXPECT_EQ(3u, outgoing_ack()->received_info.largest_observed);
+ EXPECT_EQ(3u, outgoing_ack()->largest_observed);
EXPECT_FALSE(IsMissing(2));
EXPECT_TRUE(IsMissing(1));
ProcessPacket(1);
- EXPECT_EQ(3u, outgoing_ack()->received_info.largest_observed);
+ EXPECT_EQ(3u, outgoing_ack()->largest_observed);
EXPECT_FALSE(IsMissing(2));
EXPECT_FALSE(IsMissing(1));
}
@@ -1026,14 +1027,14 @@ TEST_P(QuicConnectionTest, DuplicatePacket) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessPacket(3);
- EXPECT_EQ(3u, outgoing_ack()->received_info.largest_observed);
+ EXPECT_EQ(3u, outgoing_ack()->largest_observed);
EXPECT_TRUE(IsMissing(2));
EXPECT_TRUE(IsMissing(1));
// Send packet 3 again, but do not set the expectation that
// the visitor OnStreamFrames() will be called.
ProcessDataPacket(3, 0, !kEntropyFlag);
- EXPECT_EQ(3u, outgoing_ack()->received_info.largest_observed);
+ EXPECT_EQ(3u, outgoing_ack()->largest_observed);
EXPECT_TRUE(IsMissing(2));
EXPECT_TRUE(IsMissing(1));
}
@@ -1042,16 +1043,16 @@ TEST_P(QuicConnectionTest, PacketsOutOfOrderWithAdditionsAndLeastAwaiting) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessPacket(3);
- EXPECT_EQ(3u, outgoing_ack()->received_info.largest_observed);
+ EXPECT_EQ(3u, outgoing_ack()->largest_observed);
EXPECT_TRUE(IsMissing(2));
EXPECT_TRUE(IsMissing(1));
ProcessPacket(2);
- EXPECT_EQ(3u, outgoing_ack()->received_info.largest_observed);
+ EXPECT_EQ(3u, outgoing_ack()->largest_observed);
EXPECT_TRUE(IsMissing(1));
ProcessPacket(5);
- EXPECT_EQ(5u, outgoing_ack()->received_info.largest_observed);
+ EXPECT_EQ(5u, outgoing_ack()->largest_observed);
EXPECT_TRUE(IsMissing(1));
EXPECT_TRUE(IsMissing(4));
@@ -3155,7 +3156,7 @@ TEST_P(QuicConnectionTest, MissingPacketsBeforeLeastUnacked) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
QuicStopWaitingFrame frame = InitStopWaitingFrame(4);
ProcessStopWaitingPacket(&frame);
- EXPECT_TRUE(outgoing_ack()->received_info.missing_packets.empty());
+ EXPECT_TRUE(outgoing_ack()->missing_packets.empty());
}
TEST_P(QuicConnectionTest, ReceivedEntropyHashCalculation) {
@@ -3165,7 +3166,7 @@ TEST_P(QuicConnectionTest, ReceivedEntropyHashCalculation) {
ProcessDataPacket(4, 1, kEntropyFlag);
ProcessDataPacket(3, 1, !kEntropyFlag);
ProcessDataPacket(7, 1, kEntropyFlag);
- EXPECT_EQ(146u, outgoing_ack()->received_info.entropy_hash);
+ EXPECT_EQ(146u, outgoing_ack()->entropy_hash);
}
TEST_P(QuicConnectionTest, ReceivedEntropyHashCalculationHalfFEC) {
@@ -3176,7 +3177,7 @@ TEST_P(QuicConnectionTest, ReceivedEntropyHashCalculationHalfFEC) {
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);
+ EXPECT_EQ(146u, outgoing_ack()->entropy_hash);
}
TEST_P(QuicConnectionTest, UpdateEntropyForReceivedPackets) {
@@ -3185,7 +3186,7 @@ TEST_P(QuicConnectionTest, UpdateEntropyForReceivedPackets) {
ProcessDataPacket(1, 1, kEntropyFlag);
ProcessDataPacket(5, 1, kEntropyFlag);
ProcessDataPacket(4, 1, !kEntropyFlag);
- EXPECT_EQ(34u, outgoing_ack()->received_info.entropy_hash);
+ EXPECT_EQ(34u, outgoing_ack()->entropy_hash);
// Make 4th packet my least unacked, and update entropy for 2, 3 packets.
peer_creator_.set_sequence_number(5);
QuicPacketEntropyHash six_packet_entropy_hash = 0;
@@ -3197,7 +3198,7 @@ TEST_P(QuicConnectionTest, UpdateEntropyForReceivedPackets) {
}
EXPECT_EQ((kRandomEntropyHash + (1 << 5) + six_packet_entropy_hash),
- outgoing_ack()->received_info.entropy_hash);
+ outgoing_ack()->entropy_hash);
}
TEST_P(QuicConnectionTest, UpdateEntropyHashUptoCurrentPacket) {
@@ -3206,7 +3207,7 @@ TEST_P(QuicConnectionTest, UpdateEntropyHashUptoCurrentPacket) {
ProcessDataPacket(1, 1, kEntropyFlag);
ProcessDataPacket(5, 1, !kEntropyFlag);
ProcessDataPacket(22, 1, kEntropyFlag);
- EXPECT_EQ(66u, outgoing_ack()->received_info.entropy_hash);
+ EXPECT_EQ(66u, outgoing_ack()->entropy_hash);
peer_creator_.set_sequence_number(22);
QuicPacketEntropyHash kRandomEntropyHash = 85u;
// Current packet is the least unacked packet.
@@ -3215,10 +3216,10 @@ TEST_P(QuicConnectionTest, UpdateEntropyHashUptoCurrentPacket) {
frame.entropy_hash = kRandomEntropyHash;
ack_entropy_hash = ProcessStopWaitingPacket(&frame);
EXPECT_EQ((kRandomEntropyHash + ack_entropy_hash),
- outgoing_ack()->received_info.entropy_hash);
+ outgoing_ack()->entropy_hash);
ProcessDataPacket(25, 1, kEntropyFlag);
EXPECT_EQ((kRandomEntropyHash + ack_entropy_hash + (1 << (25 % 8))),
- outgoing_ack()->received_info.entropy_hash);
+ outgoing_ack()->entropy_hash);
}
TEST_P(QuicConnectionTest, EntropyCalculationForTruncatedAck) {
@@ -3825,7 +3826,7 @@ TEST_P(QuicConnectionTest, AckNotifierFECTriggerCallback) {
EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _));
QuicAckFrame frame = InitAckFrame(2);
NackPacket(1, &frame);
- frame.received_info.revived_packets.insert(1);
+ frame.revived_packets.insert(1);
ProcessAckPacket(&frame);
// If the ack is processed again, the notifier should not be called again.
ProcessAckPacket(&frame);
« no previous file with comments | « net/quic/quic_connection_logger.cc ('k') | net/quic/quic_framer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698