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

Unified Diff: net/quic/quic_framer_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_framer.cc ('k') | net/quic/quic_packet_creator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer_test.cc
diff --git a/net/quic/quic_framer_test.cc b/net/quic/quic_framer_test.cc
index 0885fe04b75a63ac7d5dcc3dc353671d74ca9b80..f8d1c5be27ec76d5fd2892500a15f8bd38ed3abe 100644
--- a/net/quic/quic_framer_test.cc
+++ b/net/quic/quic_framer_test.cc
@@ -1726,11 +1726,11 @@ TEST_P(QuicFramerTest, AckFrame) {
EXPECT_EQ(0u, visitor_.stream_frames_.size());
ASSERT_EQ(1u, visitor_.ack_frames_.size());
const QuicAckFrame& frame = *visitor_.ack_frames_[0];
- EXPECT_EQ(0xBA, frame.received_info.entropy_hash);
- EXPECT_EQ(GG_UINT64_C(0x0123456789ABF), frame.received_info.largest_observed);
- ASSERT_EQ(1u, frame.received_info.missing_packets.size());
+ EXPECT_EQ(0xBA, frame.entropy_hash);
+ EXPECT_EQ(GG_UINT64_C(0x0123456789ABF), frame.largest_observed);
+ ASSERT_EQ(1u, frame.missing_packets.size());
SequenceNumberSet::const_iterator missing_iter =
- frame.received_info.missing_packets.begin();
+ frame.missing_packets.begin();
EXPECT_EQ(GG_UINT64_C(0x0123456789ABE), *missing_iter);
const size_t kReceivedEntropyOffset = kQuicFrameTypeSize;
@@ -1820,11 +1820,11 @@ TEST_P(QuicFramerTest, AckFrameRevivedPackets) {
EXPECT_EQ(0u, visitor_.stream_frames_.size());
ASSERT_EQ(1u, visitor_.ack_frames_.size());
const QuicAckFrame& frame = *visitor_.ack_frames_[0];
- EXPECT_EQ(0xBA, frame.received_info.entropy_hash);
- EXPECT_EQ(GG_UINT64_C(0x0123456789ABF), frame.received_info.largest_observed);
- ASSERT_EQ(1u, frame.received_info.missing_packets.size());
+ EXPECT_EQ(0xBA, frame.entropy_hash);
+ EXPECT_EQ(GG_UINT64_C(0x0123456789ABF), frame.largest_observed);
+ ASSERT_EQ(1u, frame.missing_packets.size());
SequenceNumberSet::const_iterator missing_iter =
- frame.received_info.missing_packets.begin();
+ frame.missing_packets.begin();
EXPECT_EQ(GG_UINT64_C(0x0123456789ABE), *missing_iter);
const size_t kReceivedEntropyOffset = kQuicFrameTypeSize;
@@ -1909,10 +1909,9 @@ TEST_P(QuicFramerTest, AckFrameNoNacks) {
EXPECT_EQ(0u, visitor_.stream_frames_.size());
ASSERT_EQ(1u, visitor_.ack_frames_.size());
QuicAckFrame* frame = visitor_.ack_frames_[0];
- EXPECT_EQ(0xBA, frame->received_info.entropy_hash);
- EXPECT_EQ(GG_UINT64_C(0x0123456789ABF),
- frame->received_info.largest_observed);
- ASSERT_EQ(0u, frame->received_info.missing_packets.size());
+ EXPECT_EQ(0xBA, frame->entropy_hash);
+ EXPECT_EQ(GG_UINT64_C(0x0123456789ABF), frame->largest_observed);
+ ASSERT_EQ(0u, frame->missing_packets.size());
// Verify that the packet re-serializes identically.
QuicFrames frames;
@@ -1973,16 +1972,15 @@ TEST_P(QuicFramerTest, AckFrame500Nacks) {
EXPECT_EQ(0u, visitor_.stream_frames_.size());
ASSERT_EQ(1u, visitor_.ack_frames_.size());
QuicAckFrame* frame = visitor_.ack_frames_[0];
- EXPECT_EQ(0xBA, frame->received_info.entropy_hash);
- EXPECT_EQ(GG_UINT64_C(0x0123456789ABF),
- frame->received_info.largest_observed);
- EXPECT_EQ(0u, frame->received_info.revived_packets.size());
- ASSERT_EQ(500u, frame->received_info.missing_packets.size());
+ EXPECT_EQ(0xBA, frame->entropy_hash);
+ EXPECT_EQ(GG_UINT64_C(0x0123456789ABF), frame->largest_observed);
+ EXPECT_EQ(0u, frame->revived_packets.size());
+ ASSERT_EQ(500u, frame->missing_packets.size());
SequenceNumberSet::const_iterator first_missing_iter =
- frame->received_info.missing_packets.begin();
+ frame->missing_packets.begin();
EXPECT_EQ(GG_UINT64_C(0x0123456789ABE) - 499, *first_missing_iter);
SequenceNumberSet::const_reverse_iterator last_missing_iter =
- frame->received_info.missing_packets.rbegin();
+ frame->missing_packets.rbegin();
EXPECT_EQ(GG_UINT64_C(0x0123456789ABE), *last_missing_iter);
// Verify that the packet re-serializes identically.
@@ -2265,7 +2263,7 @@ TEST_P(QuicFramerTest, RstStreamFrameQuic) {
// Now test framing boundaries
for (size_t i = kQuicFrameTypeSize;
- i < QuicFramer::GetMinRstStreamFrameSize(version_); ++i) {
+ i < QuicFramer::GetMinRstStreamFrameSize(); ++i) {
string expected_error;
if (i < kQuicFrameTypeSize + kQuicMaxStreamIdSize) {
expected_error = "Unable to read stream_id.";
@@ -3156,10 +3154,10 @@ TEST_P(QuicFramerTest, BuildAckFramePacket) {
header.fec_group = 0;
QuicAckFrame ack_frame;
- ack_frame.received_info.entropy_hash = 0x43;
- ack_frame.received_info.largest_observed = GG_UINT64_C(0x770123456789ABF);
- ack_frame.received_info.delta_time_largest_observed = QuicTime::Delta::Zero();
- ack_frame.received_info.missing_packets.insert(
+ ack_frame.entropy_hash = 0x43;
+ ack_frame.largest_observed = GG_UINT64_C(0x770123456789ABF);
+ ack_frame.delta_time_largest_observed = QuicTime::Delta::Zero();
+ ack_frame.missing_packets.insert(
GG_UINT64_C(0x770123456789ABE));
QuicFrames frames;
@@ -3221,11 +3219,11 @@ TEST_P(QuicFramerTest, BuildTruncatedAckFrameLargePacket) {
// This entropy hash is different from what shows up in the packet below,
// since entropy is recomputed by the framer on ack truncation (by
// TestEntropyCalculator for this test.)
- ack_frame.received_info.entropy_hash = 0x43;
- ack_frame.received_info.largest_observed = 2 * 300;
- ack_frame.received_info.delta_time_largest_observed = QuicTime::Delta::Zero();
+ ack_frame.entropy_hash = 0x43;
+ ack_frame.largest_observed = 2 * 300;
+ ack_frame.delta_time_largest_observed = QuicTime::Delta::Zero();
for (size_t i = 1; i < 2 * 300; i += 2) {
- ack_frame.received_info.missing_packets.insert(i);
+ ack_frame.missing_packets.insert(i);
}
QuicFrames frames;
@@ -3334,11 +3332,11 @@ TEST_P(QuicFramerTest, BuildTruncatedAckFrameSmallPacket) {
// This entropy hash is different from what shows up in the packet below,
// since entropy is recomputed by the framer on ack truncation (by
// TestEntropyCalculator for this test.)
- ack_frame.received_info.entropy_hash = 0x43;
- ack_frame.received_info.largest_observed = 2 * 300;
- ack_frame.received_info.delta_time_largest_observed = QuicTime::Delta::Zero();
+ ack_frame.entropy_hash = 0x43;
+ ack_frame.largest_observed = 2 * 300;
+ ack_frame.delta_time_largest_observed = QuicTime::Delta::Zero();
for (size_t i = 1; i < 2 * 300; i += 2) {
- ack_frame.received_info.missing_packets.insert(i);
+ ack_frame.missing_packets.insert(i);
}
QuicFrames frames;
@@ -4104,14 +4102,14 @@ TEST_P(QuicFramerTest, AckTruncationLargePacket) {
ASSERT_TRUE(framer_.ProcessPacket(*ack_packet));
ASSERT_EQ(1u, visitor_.ack_frames_.size());
QuicAckFrame& processed_ack_frame = *visitor_.ack_frames_[0];
- EXPECT_TRUE(processed_ack_frame.received_info.is_truncated);
- EXPECT_EQ(510u, processed_ack_frame.received_info.largest_observed);
- ASSERT_EQ(255u, processed_ack_frame.received_info.missing_packets.size());
+ EXPECT_TRUE(processed_ack_frame.is_truncated);
+ EXPECT_EQ(510u, processed_ack_frame.largest_observed);
+ ASSERT_EQ(255u, processed_ack_frame.missing_packets.size());
SequenceNumberSet::const_iterator missing_iter =
- processed_ack_frame.received_info.missing_packets.begin();
+ processed_ack_frame.missing_packets.begin();
EXPECT_EQ(1u, *missing_iter);
SequenceNumberSet::const_reverse_iterator last_missing_iter =
- processed_ack_frame.received_info.missing_packets.rbegin();
+ processed_ack_frame.missing_packets.rbegin();
EXPECT_EQ(509u, *last_missing_iter);
}
@@ -4144,14 +4142,14 @@ TEST_P(QuicFramerTest, AckTruncationSmallPacket) {
ASSERT_TRUE(framer_.ProcessPacket(*ack_packet));
ASSERT_EQ(1u, visitor_.ack_frames_.size());
QuicAckFrame& processed_ack_frame = *visitor_.ack_frames_[0];
- EXPECT_TRUE(processed_ack_frame.received_info.is_truncated);
- EXPECT_EQ(476u, processed_ack_frame.received_info.largest_observed);
- ASSERT_EQ(238u, processed_ack_frame.received_info.missing_packets.size());
+ EXPECT_TRUE(processed_ack_frame.is_truncated);
+ EXPECT_EQ(476u, processed_ack_frame.largest_observed);
+ ASSERT_EQ(238u, processed_ack_frame.missing_packets.size());
SequenceNumberSet::const_iterator missing_iter =
- processed_ack_frame.received_info.missing_packets.begin();
+ processed_ack_frame.missing_packets.begin();
EXPECT_EQ(1u, *missing_iter);
SequenceNumberSet::const_reverse_iterator last_missing_iter =
- processed_ack_frame.received_info.missing_packets.rbegin();
+ processed_ack_frame.missing_packets.rbegin();
EXPECT_EQ(475u, *last_missing_iter);
}
@@ -4166,9 +4164,9 @@ TEST_P(QuicFramerTest, CleanTruncation) {
header.fec_group = 0;
QuicAckFrame ack_frame;
- ack_frame.received_info.largest_observed = 201;
- for (uint64 i = 1; i < ack_frame.received_info.largest_observed; ++i) {
- ack_frame.received_info.missing_packets.insert(i);
+ ack_frame.largest_observed = 201;
+ for (uint64 i = 1; i < ack_frame.largest_observed; ++i) {
+ ack_frame.missing_packets.insert(i);
}
// Create a packet with just the ack.
« no previous file with comments | « net/quic/quic_framer.cc ('k') | net/quic/quic_packet_creator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698