summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_framer_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/quic/quic_framer_test.cc')
-rw-r--r--net/quic/quic_framer_test.cc159
1 files changed, 0 insertions, 159 deletions
diff --git a/net/quic/quic_framer_test.cc b/net/quic/quic_framer_test.cc
index 60aad46..d14e673 100644
--- a/net/quic/quic_framer_test.cc
+++ b/net/quic/quic_framer_test.cc
@@ -2044,96 +2044,6 @@ TEST_P(QuicFramerTest, CongestionFeedbackFrameTCP) {
}
}
-TEST_P(QuicFramerTest, CongestionFeedbackFrameTimestamp) {
- unsigned char packet[] = {
- // public flags (8 byte connection_id)
- 0x3C,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // packet sequence number
- 0xBC, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // private flags
- 0x00,
-
- // frame type (congestion feedback frame)
- 0x20,
- // congestion feedback type (timestamp)
- 0x01,
- // num received packets
- 0x03,
- // lowest sequence number
- 0xBA, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // receive time
- 0x87, 0x96, 0xA5, 0xB4,
- 0xC3, 0xD2, 0xE1, 0x07,
- // sequence delta
- 0x01, 0x00,
- // time delta
- 0x01, 0x00, 0x00, 0x00,
- // sequence delta (skip one packet)
- 0x03, 0x00,
- // time delta
- 0x02, 0x00, 0x00, 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_.congestion_feedback_frames_.size());
- const QuicCongestionFeedbackFrame& frame =
- *visitor_.congestion_feedback_frames_[0];
- ASSERT_EQ(kTimestamp, frame.type);
- ASSERT_EQ(3u, frame.timestamp.received_packet_times.size());
- TimeMap::const_iterator iter =
- frame.timestamp.received_packet_times.begin();
- EXPECT_EQ(GG_UINT64_C(0x0123456789ABA), iter->first);
- EXPECT_EQ(GG_INT64_C(0x07E1D2C3B4A59687),
- iter->second.Subtract(start_).ToMicroseconds());
- ++iter;
- EXPECT_EQ(GG_UINT64_C(0x0123456789ABB), iter->first);
- EXPECT_EQ(GG_INT64_C(0x07E1D2C3B4A59688),
- iter->second.Subtract(start_).ToMicroseconds());
- ++iter;
- EXPECT_EQ(GG_UINT64_C(0x0123456789ABD), iter->first);
- EXPECT_EQ(GG_INT64_C(0x07E1D2C3B4A59689),
- iter->second.Subtract(start_).ToMicroseconds());
-
- // Now test framing boundaries
- for (size_t i = kQuicFrameTypeSize; i < 29; ++i) {
- string expected_error;
- if (i < 2) {
- expected_error = "Unable to read congestion feedback type.";
- } else if (i < 3) {
- expected_error = "Unable to read num received packets.";
- } else if (i < 9) {
- expected_error = "Unable to read smallest received.";
- } else if (i < 17) {
- expected_error = "Unable to read time received.";
- } else if (i < 19) {
- expected_error = "Unable to read sequence delta in received packets.";
- } else if (i < 23) {
- expected_error = "Unable to read time delta in received packets.";
- } else if (i < 25) {
- expected_error = "Unable to read sequence delta in received packets.";
- } else if (i < 29) {
- expected_error = "Unable to read time delta in received packets.";
- }
- CheckProcessingFails(
- packet,
- i + GetPacketHeaderSize(PACKET_8BYTE_CONNECTION_ID, !kIncludeVersion,
- PACKET_6BYTE_SEQUENCE_NUMBER, NOT_IN_FEC_GROUP),
- expected_error, QUIC_INVALID_CONGESTION_FEEDBACK_DATA);
- }
-}
-
TEST_P(QuicFramerTest, CongestionFeedbackFrameInvalidFeedback) {
unsigned char packet[] = {
// public flags (8 byte connection_id)
@@ -3428,75 +3338,6 @@ TEST_P(QuicFramerTest, BuildCongestionFeedbackFramePacketTCP) {
AsChars(packet), arraysize(packet));
}
-TEST_P(QuicFramerTest, BuildCongestionFeedbackFramePacketTimestamp) {
- 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;
-
- QuicCongestionFeedbackFrame frame;
- frame.type = kTimestamp;
- frame.timestamp.received_packet_times.insert(
- make_pair(GG_UINT64_C(0x0123456789ABA),
- start_.Add(QuicTime::Delta::FromMicroseconds(
- GG_UINT64_C(0x07E1D2C3B4A59687)))));
- frame.timestamp.received_packet_times.insert(
- make_pair(GG_UINT64_C(0x0123456789ABB),
- start_.Add(QuicTime::Delta::FromMicroseconds(
- GG_UINT64_C(0x07E1D2C3B4A59688)))));
- frame.timestamp.received_packet_times.insert(
- make_pair(GG_UINT64_C(0x0123456789ABD),
- start_.Add(QuicTime::Delta::FromMicroseconds(
- GG_UINT64_C(0x07E1D2C3B4A59689)))));
- QuicFrames frames;
- frames.push_back(QuicFrame(&frame));
-
- unsigned char packet[] = {
- // public flags (8 byte connection_id)
- 0x3C,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // packet sequence number
- 0xBC, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // private flags
- 0x00,
-
- // frame type (congestion feedback frame)
- 0x20,
- // congestion feedback type (timestamp)
- 0x01,
- // num received packets
- 0x03,
- // lowest sequence number
- 0xBA, 0x9A, 0x78, 0x56,
- 0x34, 0x12,
- // receive time
- 0x87, 0x96, 0xA5, 0xB4,
- 0xC3, 0xD2, 0xE1, 0x07,
- // sequence delta
- 0x01, 0x00,
- // time delta
- 0x01, 0x00, 0x00, 0x00,
- // sequence delta (skip one packet)
- 0x03, 0x00,
- // time delta
- 0x02, 0x00, 0x00, 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, BuildStopWaitingPacket) {
QuicPacketHeader header;
header.public_header.connection_id = GG_UINT64_C(0xFEDCBA9876543210);