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

Unified Diff: net/quic/quic_framer_test.cc

Issue 413403008: Remove QUIC_VERSION_15 now that Chrome Stable supports QUIC_VERSION_16. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0723
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_test.cc » ('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 bebaf4aeb9af4fcb4efd01575ed5f9d819dfabf4..99d8a1dc8d98ca485779a2bf0ddefb72f4eda7a5 100644
--- a/net/quic/quic_framer_test.cc
+++ b/net/quic/quic_framer_test.cc
@@ -1683,120 +1683,7 @@ TEST_P(QuicFramerTest, StreamFrameInFecGroup) {
CheckStreamFrameData("hello world!", visitor_.stream_frames_[0]);
}
-TEST_P(QuicFramerTest, AckFrame15) {
- if (framer_.version() != QUIC_VERSION_15) {
- return;
- }
-
- unsigned char packet[] = {
- // public flags (8 byte connection_id)
- 0x3C,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // packet sequence number
- 0xA8, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // private flags (entropy)
- 0x01,
-
- // frame type (ack frame)
- // (has nacks, not truncated, 6 byte largest observed, 1 byte delta)
- 0x6C,
- // entropy hash of sent packets till least awaiting - 1.
- 0xAB,
- // least packet sequence number awaiting an ack, delta from sequence number.
- 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00,
- // entropy hash of all received packets.
- 0xBA,
- // largest observed packet sequence number
- 0xBF, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // Zero delta time.
- 0x0, 0x0,
- // num missing packets
- 0x01,
- // missing packet delta
- 0x01,
- // 0 more missing packets in range.
- 0x00,
- // Number of revived packets.
- 0x00,
- };
-
- QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false);
- EXPECT_TRUE(framer_.ProcessPacket(encrypted));
-
- EXPECT_EQ(QUIC_NO_ERROR, framer_.error());
- ASSERT_TRUE(visitor_.header_.get());
- EXPECT_TRUE(CheckDecryption(encrypted, !kIncludeVersion));
-
- EXPECT_EQ(0u, visitor_.stream_frames_.size());
- ASSERT_EQ(1u, visitor_.ack_frames_.size());
- const QuicAckFrame& frame = *visitor_.ack_frames_[0];
- EXPECT_EQ(0xAB, frame.sent_info.entropy_hash);
- 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());
- SequenceNumberSet::const_iterator missing_iter =
- frame.received_info.missing_packets.begin();
- EXPECT_EQ(GG_UINT64_C(0x0123456789ABE), *missing_iter);
- EXPECT_EQ(GG_UINT64_C(0x0123456789AA0), frame.sent_info.least_unacked);
-
- const size_t kSentEntropyOffset = kQuicFrameTypeSize;
- const size_t kLeastUnackedOffset = kSentEntropyOffset + kQuicEntropyHashSize;
- const size_t kReceivedEntropyOffset = kLeastUnackedOffset +
- PACKET_6BYTE_SEQUENCE_NUMBER;
- const size_t kLargestObservedOffset = kReceivedEntropyOffset +
- kQuicEntropyHashSize;
- const size_t kMissingDeltaTimeOffset = kLargestObservedOffset +
- PACKET_6BYTE_SEQUENCE_NUMBER;
- const size_t kNumMissingPacketOffset = kMissingDeltaTimeOffset +
- kQuicDeltaTimeLargestObservedSize;
- const size_t kMissingPacketsOffset = kNumMissingPacketOffset +
- kNumberOfNackRangesSize;
- const size_t kMissingPacketsRange = kMissingPacketsOffset +
- PACKET_1BYTE_SEQUENCE_NUMBER;
- const size_t kRevivedPacketsLength = kMissingPacketsRange +
- PACKET_1BYTE_SEQUENCE_NUMBER;
- // Now test framing boundaries
- const size_t ack_frame_size = kRevivedPacketsLength +
- PACKET_1BYTE_SEQUENCE_NUMBER;
- for (size_t i = kQuicFrameTypeSize; i < ack_frame_size; ++i) {
- string expected_error;
- if (i < kLeastUnackedOffset) {
- expected_error = "Unable to read entropy hash for sent packets.";
- } else if (i < kReceivedEntropyOffset) {
- expected_error = "Unable to read least unacked delta.";
- } else if (i < kLargestObservedOffset) {
- expected_error = "Unable to read entropy hash for received packets.";
- } else if (i < kMissingDeltaTimeOffset) {
- expected_error = "Unable to read largest observed.";
- } else if (i < kNumMissingPacketOffset) {
- expected_error = "Unable to read delta time largest observed.";
- } else if (i < kMissingPacketsOffset) {
- expected_error = "Unable to read num missing packet ranges.";
- } else if (i < kMissingPacketsRange) {
- expected_error = "Unable to read missing sequence number delta.";
- } else if (i < kRevivedPacketsLength) {
- expected_error = "Unable to read missing sequence number range.";
- } else {
- expected_error = "Unable to read num revived packets.";
- }
- CheckProcessingFails(
- packet,
- i + GetPacketHeaderSize(PACKET_8BYTE_CONNECTION_ID, !kIncludeVersion,
- PACKET_6BYTE_SEQUENCE_NUMBER, NOT_IN_FEC_GROUP),
- expected_error, QUIC_INVALID_ACK_DATA);
- }
-}
-
TEST_P(QuicFramerTest, AckFrame) {
- if (framer_.version() <= QUIC_VERSION_15) {
- return;
- }
-
unsigned char packet[] = {
// public flags (8 byte connection_id)
0x3C,
@@ -1888,10 +1775,6 @@ TEST_P(QuicFramerTest, AckFrame) {
}
TEST_P(QuicFramerTest, AckFrameRevivedPackets) {
- if (framer_.version() <= QUIC_VERSION_15) {
- return;
- }
-
unsigned char packet[] = {
// public flags (8 byte connection_id)
0x3C,
@@ -1991,180 +1874,7 @@ TEST_P(QuicFramerTest, AckFrameRevivedPackets) {
}
}
-TEST_P(QuicFramerTest, AckFrameRevivedPackets15) {
- if (framer_.version() != QUIC_VERSION_15) {
- return;
- }
-
- unsigned char packet[] = {
- // public flags (8 byte connection_id)
- 0x3C,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // packet sequence number
- 0xA8, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // private flags (entropy)
- 0x01,
-
- // frame type (ack frame)
- // (has nacks, not truncated, 6 byte largest observed, 1 byte delta)
- 0x6C,
- // entropy hash of sent packets till least awaiting - 1.
- 0xAB,
- // least packet sequence number awaiting an ack, delta from sequence number.
- 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00,
- // entropy hash of all received packets.
- 0xBA,
- // largest observed packet sequence number
- 0xBF, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // Zero delta time.
- 0x0, 0x0,
- // num missing packets
- 0x01,
- // missing packet delta
- 0x01,
- // 0 more missing packets in range.
- 0x00,
- // Number of revived packets.
- 0x01,
- // Revived packet sequence number.
- 0xBE, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- };
-
- QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false);
- EXPECT_TRUE(framer_.ProcessPacket(encrypted));
-
- EXPECT_EQ(QUIC_NO_ERROR, framer_.error());
- ASSERT_TRUE(visitor_.header_.get());
- EXPECT_TRUE(CheckDecryption(encrypted, !kIncludeVersion));
-
- EXPECT_EQ(0u, visitor_.stream_frames_.size());
- ASSERT_EQ(1u, visitor_.ack_frames_.size());
- const QuicAckFrame& frame = *visitor_.ack_frames_[0];
- EXPECT_EQ(0xAB, frame.sent_info.entropy_hash);
- 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());
- SequenceNumberSet::const_iterator missing_iter =
- frame.received_info.missing_packets.begin();
- EXPECT_EQ(GG_UINT64_C(0x0123456789ABE), *missing_iter);
- EXPECT_EQ(GG_UINT64_C(0x0123456789AA0), frame.sent_info.least_unacked);
-
- const size_t kSentEntropyOffset = kQuicFrameTypeSize;
- const size_t kLeastUnackedOffset = kSentEntropyOffset + kQuicEntropyHashSize;
- const size_t kReceivedEntropyOffset = kLeastUnackedOffset +
- PACKET_6BYTE_SEQUENCE_NUMBER;
- const size_t kLargestObservedOffset = kReceivedEntropyOffset +
- kQuicEntropyHashSize;
- const size_t kMissingDeltaTimeOffset = kLargestObservedOffset +
- PACKET_6BYTE_SEQUENCE_NUMBER;
- const size_t kNumMissingPacketOffset = kMissingDeltaTimeOffset +
- kQuicDeltaTimeLargestObservedSize;
- const size_t kMissingPacketsOffset = kNumMissingPacketOffset +
- kNumberOfNackRangesSize;
- const size_t kMissingPacketsRange = kMissingPacketsOffset +
- PACKET_1BYTE_SEQUENCE_NUMBER;
- const size_t kRevivedPacketsLength = kMissingPacketsRange +
- PACKET_1BYTE_SEQUENCE_NUMBER;
- const size_t kRevivedPacketSequenceNumberLength = kRevivedPacketsLength +
- PACKET_1BYTE_SEQUENCE_NUMBER;
- // Now test framing boundaries
- const size_t ack_frame_size = kRevivedPacketSequenceNumberLength +
- PACKET_6BYTE_SEQUENCE_NUMBER;
- for (size_t i = kQuicFrameTypeSize; i < ack_frame_size; ++i) {
- string expected_error;
- if (i < kLeastUnackedOffset) {
- expected_error = "Unable to read entropy hash for sent packets.";
- } else if (i < kReceivedEntropyOffset) {
- expected_error = "Unable to read least unacked delta.";
- } else if (i < kLargestObservedOffset) {
- expected_error = "Unable to read entropy hash for received packets.";
- } else if (i < kMissingDeltaTimeOffset) {
- expected_error = "Unable to read largest observed.";
- } else if (i < kNumMissingPacketOffset) {
- expected_error = "Unable to read delta time largest observed.";
- } else if (i < kMissingPacketsOffset) {
- expected_error = "Unable to read num missing packet ranges.";
- } else if (i < kMissingPacketsRange) {
- expected_error = "Unable to read missing sequence number delta.";
- } else if (i < kRevivedPacketsLength) {
- expected_error = "Unable to read missing sequence number range.";
- } else if (i < kRevivedPacketSequenceNumberLength) {
- expected_error = "Unable to read num revived packets.";
- } else {
- expected_error = "Unable to read revived packet.";
- }
- CheckProcessingFails(
- packet,
- i + GetPacketHeaderSize(PACKET_8BYTE_CONNECTION_ID, !kIncludeVersion,
- PACKET_6BYTE_SEQUENCE_NUMBER, NOT_IN_FEC_GROUP),
- expected_error, QUIC_INVALID_ACK_DATA);
- }
-}
-
TEST_P(QuicFramerTest, AckFrameNoNacks) {
- if (framer_.version() <= QUIC_VERSION_15) {
- return;
- }
- unsigned char packet[] = {
- // public flags (8 byte connection_id)
- 0x3C,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // packet sequence number
- 0xA8, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // private flags (entropy)
- 0x01,
-
- // frame type (ack frame)
- // (no nacks, not truncated, 6 byte largest observed, 1 byte delta)
- 0x4C,
- // entropy hash of all received packets.
- 0xBA,
- // largest observed packet sequence number
- 0xBF, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // Zero delta time.
- 0x0, 0x0,
- };
-
- QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false);
- EXPECT_TRUE(framer_.ProcessPacket(encrypted));
-
- EXPECT_EQ(QUIC_NO_ERROR, framer_.error());
- ASSERT_TRUE(visitor_.header_.get());
- EXPECT_TRUE(CheckDecryption(encrypted, !kIncludeVersion));
-
- 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());
-
- // Verify that the packet re-serializes identically.
- QuicFrames frames;
- frames.push_back(QuicFrame(frame));
- scoped_ptr<QuicPacket> data(BuildDataPacket(*visitor_.header_, frames));
- ASSERT_TRUE(data != NULL);
-
- test::CompareCharArraysWithHexError("constructed packet",
- data->data(), data->length(),
- AsChars(packet), arraysize(packet));
-}
-
-TEST_P(QuicFramerTest, AckFrameNoNacks15) {
- if (framer_.version() > QUIC_VERSION_15) {
- return;
- }
unsigned char packet[] = {
// public flags (8 byte connection_id)
0x3C,
@@ -2180,11 +1890,6 @@ TEST_P(QuicFramerTest, AckFrameNoNacks15) {
// frame type (ack frame)
// (no nacks, not truncated, 6 byte largest observed, 1 byte delta)
0x4C,
- // entropy hash of sent packets till least awaiting - 1.
- 0xAB,
- // least packet sequence number awaiting an ack, delta from sequence number.
- 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00,
// entropy hash of all received packets.
0xBA,
// largest observed packet sequence number
@@ -2204,12 +1909,10 @@ TEST_P(QuicFramerTest, AckFrameNoNacks15) {
EXPECT_EQ(0u, visitor_.stream_frames_.size());
ASSERT_EQ(1u, visitor_.ack_frames_.size());
QuicAckFrame* frame = visitor_.ack_frames_[0];
- EXPECT_EQ(0xAB, frame->sent_info.entropy_hash);
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(GG_UINT64_C(0x0123456789AA0), frame->sent_info.least_unacked);
// Verify that the packet re-serializes identically.
QuicFrames frames;
@@ -2223,83 +1926,6 @@ TEST_P(QuicFramerTest, AckFrameNoNacks15) {
}
TEST_P(QuicFramerTest, AckFrame500Nacks) {
- if (framer_.version() <= QUIC_VERSION_15) {
- return;
- }
- unsigned char packet[] = {
- // public flags (8 byte connection_id)
- 0x3C,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // packet sequence number
- 0xA8, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // private flags (entropy)
- 0x01,
-
- // frame type (ack frame)
- // (has nacks, not truncated, 6 byte largest observed, 1 byte delta)
- 0x6C,
- // entropy hash of all received packets.
- 0xBA,
- // largest observed packet sequence number
- 0xBF, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // Zero delta time.
- 0x0, 0x0,
- // num missing packet ranges
- 0x02,
- // missing packet delta
- 0x01,
- // 243 more missing packets in range.
- // The ranges are listed in this order so the re-constructed packet matches.
- 0xF3,
- // No gap between ranges
- 0x00,
- // 255 more missing packets in range.
- 0xFF,
- // No revived packets.
- 0x00,
- };
-
- QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false);
- EXPECT_TRUE(framer_.ProcessPacket(encrypted));
-
- EXPECT_EQ(QUIC_NO_ERROR, framer_.error());
- ASSERT_TRUE(visitor_.header_.get());
- EXPECT_TRUE(CheckDecryption(encrypted, !kIncludeVersion));
-
- 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());
- SequenceNumberSet::const_iterator first_missing_iter =
- frame->received_info.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();
- EXPECT_EQ(GG_UINT64_C(0x0123456789ABE), *last_missing_iter);
-
- // Verify that the packet re-serializes identically.
- QuicFrames frames;
- frames.push_back(QuicFrame(frame));
- scoped_ptr<QuicPacket> data(BuildDataPacket(*visitor_.header_, frames));
- ASSERT_TRUE(data != NULL);
-
- test::CompareCharArraysWithHexError("constructed packet",
- data->data(), data->length(),
- AsChars(packet), arraysize(packet));
-}
-
-TEST_P(QuicFramerTest, AckFrame500Nacks15) {
- if (framer_.version() != QUIC_VERSION_15) {
- return;
- }
unsigned char packet[] = {
// public flags (8 byte connection_id)
0x3C,
@@ -2315,11 +1941,6 @@ TEST_P(QuicFramerTest, AckFrame500Nacks15) {
// frame type (ack frame)
// (has nacks, not truncated, 6 byte largest observed, 1 byte delta)
0x6C,
- // entropy hash of sent packets till least awaiting - 1.
- 0xAB,
- // least packet sequence number awaiting an ack, delta from sequence number.
- 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00,
// entropy hash of all received packets.
0xBA,
// largest observed packet sequence number
@@ -2352,7 +1973,6 @@ TEST_P(QuicFramerTest, AckFrame500Nacks15) {
EXPECT_EQ(0u, visitor_.stream_frames_.size());
ASSERT_EQ(1u, visitor_.ack_frames_.size());
QuicAckFrame* frame = visitor_.ack_frames_[0];
- EXPECT_EQ(0xAB, frame->sent_info.entropy_hash);
EXPECT_EQ(0xBA, frame->received_info.entropy_hash);
EXPECT_EQ(GG_UINT64_C(0x0123456789ABF),
frame->received_info.largest_observed);
@@ -2364,7 +1984,6 @@ TEST_P(QuicFramerTest, AckFrame500Nacks15) {
SequenceNumberSet::const_reverse_iterator last_missing_iter =
frame->received_info.missing_packets.rbegin();
EXPECT_EQ(GG_UINT64_C(0x0123456789ABE), *last_missing_iter);
- EXPECT_EQ(GG_UINT64_C(0x0123456789AA0), frame->sent_info.least_unacked);
// Verify that the packet re-serializes identically.
QuicFrames frames;
@@ -2596,9 +2215,6 @@ TEST_P(QuicFramerTest, CongestionFeedbackFrameInvalidFeedback) {
}
TEST_P(QuicFramerTest, StopWaitingFrame) {
- if (framer_.version() <= QUIC_VERSION_15) {
- return;
- }
unsigned char packet[] = {
// public flags (8 byte connection_id)
0x3C,
@@ -3582,72 +3198,6 @@ TEST_P(QuicFramerTest, BuildVersionNegotiationPacket) {
}
TEST_P(QuicFramerTest, BuildAckFramePacket) {
- if (version_ <= QUIC_VERSION_15) {
- return;
- }
- QuicPacketHeader header;
- header.public_header.connection_id = GG_UINT64_C(0xFEDCBA9876543210);
- header.public_header.reset_flag = false;
- header.public_header.version_flag = false;
- header.fec_flag = false;
- header.entropy_flag = true;
- header.packet_sequence_number = GG_UINT64_C(0x770123456789AA8);
- 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(
- GG_UINT64_C(0x770123456789ABE));
-
- QuicFrames frames;
- frames.push_back(QuicFrame(&ack_frame));
-
- unsigned char packet[] = {
- // public flags (8 byte connection_id)
- 0x3C,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // packet sequence number
- 0xA8, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // private flags (entropy)
- 0x01,
-
- // frame type (ack frame)
- // (has nacks, not truncated, 6 byte largest observed, 1 byte delta)
- 0x6C,
- // entropy hash of all received packets.
- 0x43,
- // largest observed packet sequence number
- 0xBF, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // Zero delta time.
- 0x0, 0x0,
- // num missing packet ranges
- 0x01,
- // missing packet delta
- 0x01,
- // 0 more missing packets in range.
- 0x00,
- // 0 revived packets.
- 0x00,
- };
-
- scoped_ptr<QuicPacket> data(BuildDataPacket(header, frames));
- ASSERT_TRUE(data != NULL);
-
- test::CompareCharArraysWithHexError("constructed packet",
- data->data(), data->length(),
- AsChars(packet), arraysize(packet));
-}
-
-TEST_P(QuicFramerTest, BuildAckFramePacket15) {
- if (version_ != QUIC_VERSION_15) {
- return;
- }
QuicPacketHeader header;
header.public_header.connection_id = GG_UINT64_C(0xFEDCBA9876543210);
header.public_header.reset_flag = false;
@@ -3663,8 +3213,6 @@ TEST_P(QuicFramerTest, BuildAckFramePacket15) {
ack_frame.received_info.delta_time_largest_observed = QuicTime::Delta::Zero();
ack_frame.received_info.missing_packets.insert(
GG_UINT64_C(0x770123456789ABE));
- ack_frame.sent_info.entropy_hash = 0x14;
- ack_frame.sent_info.least_unacked = GG_UINT64_C(0x770123456789AA0);
QuicFrames frames;
frames.push_back(QuicFrame(&ack_frame));
@@ -3684,11 +3232,6 @@ TEST_P(QuicFramerTest, BuildAckFramePacket15) {
// frame type (ack frame)
// (has nacks, not truncated, 6 byte largest observed, 1 byte delta)
0x6C,
- // entropy hash of sent packets till least awaiting - 1.
- 0x14,
- // least packet sequence number awaiting an ack, delta from sequence number.
- 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00,
// entropy hash of all received packets.
0x43,
// largest observed packet sequence number
@@ -3717,9 +3260,6 @@ TEST_P(QuicFramerTest, BuildAckFramePacket15) {
// TODO(jri): Add test for tuncated packets in which the original ack frame had
// revived packets. (In both the large and small packet cases below).
TEST_P(QuicFramerTest, BuildTruncatedAckFrameLargePacket) {
- if (version_ <= QUIC_VERSION_15) {
- return;
- }
QuicPacketHeader header;
header.public_header.connection_id = GG_UINT64_C(0xFEDCBA9876543210);
header.public_header.reset_flag = false;
@@ -3833,9 +3373,6 @@ TEST_P(QuicFramerTest, BuildTruncatedAckFrameLargePacket) {
TEST_P(QuicFramerTest, BuildTruncatedAckFrameSmallPacket) {
- if (version_ <= QUIC_VERSION_15) {
- return;
- }
QuicPacketHeader header;
header.public_header.connection_id = GG_UINT64_C(0xFEDCBA9876543210);
header.public_header.reset_flag = false;
@@ -4016,9 +3553,6 @@ TEST_P(QuicFramerTest, BuildCongestionFeedbackFramePacketInterArrival) {
}
TEST_P(QuicFramerTest, BuildStopWaitingPacket) {
- if (version_ <= QUIC_VERSION_15) {
- return;
- }
QuicPacketHeader header;
header.public_header.connection_id = GG_UINT64_C(0xFEDCBA9876543210);
header.public_header.reset_flag = false;
@@ -4640,9 +4174,6 @@ TEST_P(QuicFramerTest, EncryptPacketWithVersionFlag) {
}
TEST_P(QuicFramerTest, AckTruncationLargePacket) {
- if (framer_.version() <= QUIC_VERSION_15) {
- return;
- }
QuicPacketHeader header;
header.public_header.connection_id = GG_UINT64_C(0xFEDCBA9876543210);
header.public_header.reset_flag = false;
@@ -4683,9 +4214,6 @@ TEST_P(QuicFramerTest, AckTruncationLargePacket) {
}
TEST_P(QuicFramerTest, AckTruncationSmallPacket) {
- if (framer_.version() <= QUIC_VERSION_15) {
- return;
- }
QuicPacketHeader header;
header.public_header.connection_id = GG_UINT64_C(0xFEDCBA9876543210);
header.public_header.reset_flag = false;
@@ -4725,57 +4253,6 @@ TEST_P(QuicFramerTest, AckTruncationSmallPacket) {
EXPECT_EQ(475u, *last_missing_iter);
}
-TEST_P(QuicFramerTest, Truncation15) {
- if (framer_.version() > QUIC_VERSION_15) {
- return;
- }
- QuicPacketHeader header;
- header.public_header.connection_id = GG_UINT64_C(0xFEDCBA9876543210);
- header.public_header.reset_flag = false;
- header.public_header.version_flag = false;
- header.fec_flag = false;
- header.entropy_flag = false;
- header.packet_sequence_number = GG_UINT64_C(0x123456789ABC);
- header.fec_group = 0;
-
- QuicAckFrame ack_frame;
- ack_frame.received_info.largest_observed = 601;
- ack_frame.sent_info.least_unacked = header.packet_sequence_number - 1;
- for (uint64 i = 1; i < ack_frame.received_info.largest_observed; i += 2) {
- ack_frame.received_info.missing_packets.insert(i);
- }
-
- // Create a packet with just the ack.
- QuicFrame frame;
- frame.type = ACK_FRAME;
- frame.ack_frame = &ack_frame;
- QuicFrames frames;
- frames.push_back(frame);
-
- scoped_ptr<QuicPacket> raw_ack_packet(BuildDataPacket(header, frames));
- ASSERT_TRUE(raw_ack_packet != NULL);
-
- scoped_ptr<QuicEncryptedPacket> ack_packet(
- framer_.EncryptPacket(ENCRYPTION_NONE, header.packet_sequence_number,
- *raw_ack_packet));
-
- // Now make sure we can turn our ack packet back into an ack frame.
- ASSERT_TRUE(framer_.ProcessPacket(*ack_packet));
- ASSERT_EQ(1u, visitor_.ack_frames_.size());
- const QuicAckFrame& processed_ack_frame = *visitor_.ack_frames_[0];
- EXPECT_EQ(header.packet_sequence_number - 1,
- processed_ack_frame.sent_info.least_unacked);
- 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());
- SequenceNumberSet::const_iterator missing_iter =
- processed_ack_frame.received_info.missing_packets.begin();
- EXPECT_EQ(1u, *missing_iter);
- SequenceNumberSet::const_reverse_iterator last_missing_iter =
- processed_ack_frame.received_info.missing_packets.rbegin();
- EXPECT_EQ(509u, *last_missing_iter);
-}
-
TEST_P(QuicFramerTest, CleanTruncation) {
QuicPacketHeader header;
header.public_header.connection_id = GG_UINT64_C(0xFEDCBA9876543210);
@@ -4788,7 +4265,6 @@ TEST_P(QuicFramerTest, CleanTruncation) {
QuicAckFrame ack_frame;
ack_frame.received_info.largest_observed = 201;
- ack_frame.sent_info.least_unacked = header.packet_sequence_number - 2;
for (uint64 i = 1; i < ack_frame.received_info.largest_observed; ++i) {
ack_frame.received_info.missing_packets.insert(i);
}
« no previous file with comments | « net/quic/quic_framer.cc ('k') | net/quic/quic_packet_creator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698