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

Unified Diff: net/quic/core/quic_framer_test.cc

Issue 2846003002: Deprecate FLAGS_quic_reloadable_flag_quic_remove_packet_number_from_public_reset. (Closed)
Patch Set: remove the deprecated flag Created 3 years, 8 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/core/quic_framer.cc ('k') | net/quic/core/quic_packets.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_framer_test.cc
diff --git a/net/quic/core/quic_framer_test.cc b/net/quic/core/quic_framer_test.cc
index a39a272f423f99fda1bc4f5d52e54b6f1054903a..ca36bc7574baa9133db08ae90b9d26fc223ee3f4 100644
--- a/net/quic/core/quic_framer_test.cc
+++ b/net/quic/core/quic_framer_test.cc
@@ -2855,7 +2855,6 @@ TEST_P(QuicFramerTest, PublicResetPacketV33) {
EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag);
EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag);
EXPECT_EQ(kNonceProof, visitor_.public_reset_packet_->nonce_proof);
- EXPECT_EQ(0u, visitor_.public_reset_packet_->rejected_packet_number);
EXPECT_EQ(
IpAddressFamily::IP_UNSPEC,
visitor_.public_reset_packet_->client_address.host().address_family());
@@ -2974,7 +2973,6 @@ TEST_P(QuicFramerTest, PublicResetPacket) {
EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag);
EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag);
EXPECT_EQ(kNonceProof, visitor_.public_reset_packet_->nonce_proof);
- EXPECT_EQ(0u, visitor_.public_reset_packet_->rejected_packet_number);
EXPECT_EQ(
IpAddressFamily::IP_UNSPEC,
visitor_.public_reset_packet_->client_address.host().address_family());
@@ -3176,7 +3174,6 @@ TEST_P(QuicFramerTest, PublicResetPacketWithClientAddress) {
EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag);
EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag);
EXPECT_EQ(kNonceProof, visitor_.public_reset_packet_->nonce_proof);
- EXPECT_EQ(0u, visitor_.public_reset_packet_->rejected_packet_number);
EXPECT_EQ("4.31.198.44",
visitor_.public_reset_packet_->client_address.host().ToString());
EXPECT_EQ(443, visitor_.public_reset_packet_->client_address.port());
@@ -4784,7 +4781,6 @@ TEST_P(QuicFramerTest, BuildPublicResetPacketOld) {
reset_packet.public_header.connection_id = kConnectionId;
reset_packet.public_header.reset_flag = true;
reset_packet.public_header.version_flag = false;
- reset_packet.rejected_packet_number = kPacketNumber;
reset_packet.nonce_proof = kNonceProof;
// clang-format off
@@ -4796,57 +4792,6 @@ TEST_P(QuicFramerTest, BuildPublicResetPacketOld) {
0x98, 0xBA, 0xDC, 0xFE,
// message tag (kPRST)
'P', 'R', 'S', 'T',
- // num_entries (2) + padding
- 0x02, 0x00, 0x00, 0x00,
- // tag kRNON
- 'R', 'N', 'O', 'N',
- // end offset 8
- 0x08, 0x00, 0x00, 0x00,
- // tag kRSEQ
- 'R', 'S', 'E', 'Q',
- // end offset 16
- 0x10, 0x00, 0x00, 0x00,
- // nonce proof
- 0x89, 0x67, 0x45, 0x23,
- 0x01, 0xEF, 0xCD, 0xAB,
- // rejected packet number
- 0xBC, 0x9A, 0x78, 0x56,
- 0x34, 0x12, 0x00, 0x00,
- };
-
- unsigned char packet_cid_be[] = {
- // public flags (public reset, 8 byte ConnectionId)
- 0x0E,
- // connection_id
- 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
- // message tag (kPRST)
- 'P', 'R', 'S', 'T',
- // num_entries (2) + padding
- 0x02, 0x00, 0x00, 0x00,
- // tag kRNON
- 'R', 'N', 'O', 'N',
- // end offset 8
- 0x08, 0x00, 0x00, 0x00,
- // tag kRSEQ
- 'R', 'S', 'E', 'Q',
- // end offset 16
- 0x10, 0x00, 0x00, 0x00,
- // nonce proof
- 0x89, 0x67, 0x45, 0x23,
- 0x01, 0xEF, 0xCD, 0xAB,
- // rejected packet number
- 0xBC, 0x9A, 0x78, 0x56,
- 0x34, 0x12, 0x00, 0x00,
- };
-
- unsigned char packet_no_rejected_packet_number[] = {
- // public flags (public reset, 8 byte ConnectionId)
- 0x0E,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // message tag (kPRST)
- 'P', 'R', 'S', 'T',
// num_entries (1) + padding
0x01, 0x00, 0x00, 0x00,
// tag kRNON
@@ -4858,7 +4803,7 @@ TEST_P(QuicFramerTest, BuildPublicResetPacketOld) {
0x01, 0xEF, 0xCD, 0xAB,
};
- unsigned char packet_no_rejected_packet_number_cid_be[] = {
+ unsigned char packet_cid_be[] = {
// public flags (public reset, 8 byte ConnectionId)
0x0E,
// connection_id
@@ -4880,27 +4825,15 @@ TEST_P(QuicFramerTest, BuildPublicResetPacketOld) {
std::unique_ptr<QuicEncryptedPacket> data(
framer_.BuildPublicResetPacket(reset_packet));
ASSERT_TRUE(data != nullptr);
- if (FLAGS_quic_reloadable_flag_quic_remove_packet_number_from_public_reset) {
- test::CompareCharArraysWithHexError(
- "constructed packet", data->data(), data->length(),
- AsChars(
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? packet_no_rejected_packet_number_cid_be
- : packet_no_rejected_packet_number),
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? arraysize(packet_no_rejected_packet_number_cid_be)
- : arraysize(packet_no_rejected_packet_number));
- } else {
- test::CompareCharArraysWithHexError(
- "constructed packet", data->data(), data->length(),
- AsChars(
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? packet_cid_be
- : packet),
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? arraysize(packet_cid_be)
- : arraysize(packet));
- }
+ test::CompareCharArraysWithHexError(
+ "constructed packet", data->data(), data->length(),
+ AsChars(
+ QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
+ ? packet_cid_be
+ : packet),
+ QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
+ ? arraysize(packet_cid_be)
+ : arraysize(packet));
}
TEST_P(QuicFramerTest, BuildPublicResetPacket) {
@@ -4909,96 +4842,45 @@ TEST_P(QuicFramerTest, BuildPublicResetPacket) {
reset_packet.public_header.connection_id = kConnectionId;
reset_packet.public_header.reset_flag = true;
reset_packet.public_header.version_flag = false;
- reset_packet.rejected_packet_number = kPacketNumber;
reset_packet.nonce_proof = kNonceProof;
// clang-format off
unsigned char packet[] = {
- // public flags (public reset, 8 byte ConnectionId)
- 0x0A,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // message tag (kPRST)
- 'P', 'R', 'S', 'T',
- // num_entries (2) + padding
- 0x02, 0x00, 0x00, 0x00,
- // tag kRNON
- 'R', 'N', 'O', 'N',
- // end offset 8
- 0x08, 0x00, 0x00, 0x00,
- // tag kRSEQ
- 'R', 'S', 'E', 'Q',
- // end offset 16
- 0x10, 0x00, 0x00, 0x00,
- // nonce proof
- 0x89, 0x67, 0x45, 0x23,
- 0x01, 0xEF, 0xCD, 0xAB,
- // rejected packet number
- 0xBC, 0x9A, 0x78, 0x56,
- 0x34, 0x12, 0x00, 0x00,
+ // public flags (public reset, 8 byte ConnectionId)
+ 0x0A,
+ // connection_id
+ 0x10, 0x32, 0x54, 0x76,
+ 0x98, 0xBA, 0xDC, 0xFE,
+ // message tag (kPRST)
+ 'P', 'R', 'S', 'T',
+ // num_entries (1) + padding
+ 0x01, 0x00, 0x00, 0x00,
+ // tag kRNON
+ 'R', 'N', 'O', 'N',
+ // end offset 8
+ 0x08, 0x00, 0x00, 0x00,
+ // nonce proof
+ 0x89, 0x67, 0x45, 0x23,
+ 0x01, 0xEF, 0xCD, 0xAB,
};
unsigned char packet_cid_be[] = {
- // public flags (public reset, 8 byte ConnectionId)
- 0x0A,
- // connection_id
- 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
- // message tag (kPRST)
- 'P', 'R', 'S', 'T',
- // num_entries (2) + padding
- 0x02, 0x00, 0x00, 0x00,
- // tag kRNON
- 'R', 'N', 'O', 'N',
- // end offset 8
- 0x08, 0x00, 0x00, 0x00,
- // tag kRSEQ
- 'R', 'S', 'E', 'Q',
- // end offset 16
- 0x10, 0x00, 0x00, 0x00,
- // nonce proof
- 0x89, 0x67, 0x45, 0x23,
- 0x01, 0xEF, 0xCD, 0xAB,
- // rejected packet number
- 0xBC, 0x9A, 0x78, 0x56,
- 0x34, 0x12, 0x00, 0x00,
- };
-
- unsigned char packet_no_rejected_packet_number[] = {
- // public flags (public reset, 8 byte ConnectionId)
- 0x0A,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // message tag (kPRST)
- 'P', 'R', 'S', 'T',
- // num_entries (1) + padding
- 0x01, 0x00, 0x00, 0x00,
- // tag kRNON
- 'R', 'N', 'O', 'N',
- // end offset 8
- 0x08, 0x00, 0x00, 0x00,
- // nonce proof
- 0x89, 0x67, 0x45, 0x23,
- 0x01, 0xEF, 0xCD, 0xAB,
- };
-
- unsigned char packet_no_rejected_packet_number_cid_be[] = {
- // public flags (public reset, 8 byte ConnectionId)
- 0x0A,
- // connection_id
- 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
- // message tag (kPRST)
- 'P', 'R', 'S', 'T',
- // num_entries (1) + padding
- 0x01, 0x00, 0x00, 0x00,
- // tag kRNON
- 'R', 'N', 'O', 'N',
- // end offset 8
- 0x08, 0x00, 0x00, 0x00,
- // nonce proof
- 0x89, 0x67, 0x45, 0x23,
- 0x01, 0xEF, 0xCD, 0xAB,
+ // public flags (public reset, 8 byte ConnectionId)
+ 0x0A,
+ // connection_id
+ 0xFE, 0xDC, 0xBA, 0x98,
+ 0x76, 0x54, 0x32, 0x10,
+ // message tag (kPRST)
+ 'P', 'R', 'S', 'T',
+ // num_entries (1) + padding
+ 0x01, 0x00, 0x00, 0x00,
+ // tag kRNON
+ 'R', 'N', 'O', 'N',
+ // end offset 8
+ 0x08, 0x00, 0x00, 0x00,
+ // nonce proof
+ 0x89, 0x67, 0x45, 0x23,
+ 0x01, 0xEF, 0xCD, 0xAB,
};
// clang-format on
@@ -5006,27 +4888,15 @@ TEST_P(QuicFramerTest, BuildPublicResetPacket) {
framer_.BuildPublicResetPacket(reset_packet));
ASSERT_TRUE(data != nullptr);
- if (FLAGS_quic_reloadable_flag_quic_remove_packet_number_from_public_reset) {
- test::CompareCharArraysWithHexError(
- "constructed packet", data->data(), data->length(),
- AsChars(
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? packet_no_rejected_packet_number_cid_be
- : packet_no_rejected_packet_number),
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? arraysize(packet_no_rejected_packet_number_cid_be)
- : arraysize(packet_no_rejected_packet_number));
- } else {
- test::CompareCharArraysWithHexError(
- "constructed packet", data->data(), data->length(),
- AsChars(
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? packet_cid_be
- : packet),
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? arraysize(packet_cid_be)
- : arraysize(packet));
- }
+ test::CompareCharArraysWithHexError(
+ "constructed packet", data->data(), data->length(),
+ AsChars(
+ QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
+ ? packet_cid_be
+ : packet),
+ QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
+ ? arraysize(packet_cid_be)
+ : arraysize(packet));
}
TEST_P(QuicFramerTest, BuildPublicResetPacketWithClientAddress) {
@@ -5035,80 +4905,12 @@ TEST_P(QuicFramerTest, BuildPublicResetPacketWithClientAddress) {
reset_packet.public_header.connection_id = kConnectionId;
reset_packet.public_header.reset_flag = true;
reset_packet.public_header.version_flag = false;
- reset_packet.rejected_packet_number = kPacketNumber;
reset_packet.nonce_proof = kNonceProof;
reset_packet.client_address =
QuicSocketAddress(QuicIpAddress::Loopback4(), 0x1234);
// clang-format off
unsigned char packet[] = {
- // public flags (public reset, 8 byte ConnectionId)
- 0x0A,
- // connection_id
- 0x10, 0x32, 0x54, 0x76,
- 0x98, 0xBA, 0xDC, 0xFE,
- // message tag (kPRST)
- 'P', 'R', 'S', 'T',
- // num_entries (3) + padding
- 0x03, 0x00, 0x00, 0x00,
- // tag kRNON
- 'R', 'N', 'O', 'N',
- // end offset 8
- 0x08, 0x00, 0x00, 0x00,
- // tag kRSEQ
- 'R', 'S', 'E', 'Q',
- // end offset 16
- 0x10, 0x00, 0x00, 0x00,
- // tag kCADR
- 'C', 'A', 'D', 'R',
- // end offset 24
- 0x18, 0x00, 0x00, 0x00,
- // nonce proof
- 0x89, 0x67, 0x45, 0x23,
- 0x01, 0xEF, 0xCD, 0xAB,
- // rejected packet number
- 0xBC, 0x9A, 0x78, 0x56,
- 0x34, 0x12, 0x00, 0x00,
- // client address
- 0x02, 0x00,
- 0x7F, 0x00, 0x00, 0x01,
- 0x34, 0x12,
- };
-
- unsigned char packet_cid_be[] = {
- // public flags (public reset, 8 byte ConnectionId)
- 0x0A,
- // connection_id
- 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
- // message tag (kPRST)
- 'P', 'R', 'S', 'T',
- // num_entries (3) + padding
- 0x03, 0x00, 0x00, 0x00,
- // tag kRNON
- 'R', 'N', 'O', 'N',
- // end offset 8
- 0x08, 0x00, 0x00, 0x00,
- // tag kRSEQ
- 'R', 'S', 'E', 'Q',
- // end offset 16
- 0x10, 0x00, 0x00, 0x00,
- // tag kCADR
- 'C', 'A', 'D', 'R',
- // end offset 24
- 0x18, 0x00, 0x00, 0x00,
- // nonce proof
- 0x89, 0x67, 0x45, 0x23,
- 0x01, 0xEF, 0xCD, 0xAB,
- // rejected packet number
- 0xBC, 0x9A, 0x78, 0x56,
- 0x34, 0x12, 0x00, 0x00,
- // client address
- 0x02, 0x00,
- 0x7F, 0x00, 0x00, 0x01,
- 0x34, 0x12,
- };
-
- unsigned char packet_no_rejected_packet_number[] = {
// public flags (public reset, 8 byte ConnectionId)
0x0A,
// connection_id
@@ -5135,11 +4937,12 @@ TEST_P(QuicFramerTest, BuildPublicResetPacketWithClientAddress) {
0x34, 0x12,
};
- unsigned char packet_no_rejected_packet_number_cid_be[] = {
+ unsigned char packet_cid_be[] = {
// public flags (public reset, 8 byte ConnectionId)
0x0A,
// connection_id
- 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
+ 0xFE, 0xDC, 0xBA, 0x98,
+ 0x76, 0x54, 0x32, 0x10,
// message tag (kPRST)
'P', 'R', 'S', 'T',
// num_entries (2) + padding
@@ -5166,29 +4969,16 @@ TEST_P(QuicFramerTest, BuildPublicResetPacketWithClientAddress) {
framer_.BuildPublicResetPacket(reset_packet));
ASSERT_TRUE(data != nullptr);
- if (FLAGS_quic_reloadable_flag_quic_remove_packet_number_from_public_reset) {
- test::CompareCharArraysWithHexError(
- "constructed packet", data->data(), data->length(),
- AsChars(
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? packet_no_rejected_packet_number_cid_be
- : packet_no_rejected_packet_number),
-
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? arraysize(packet_no_rejected_packet_number_cid_be)
- : arraysize(packet_no_rejected_packet_number));
- } else {
- test::CompareCharArraysWithHexError(
- "constructed packet", data->data(), data->length(),
- AsChars(
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? packet_cid_be
- : packet),
+ test::CompareCharArraysWithHexError(
+ "constructed packet", data->data(), data->length(),
+ AsChars(
+ QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
+ ? packet_cid_be
+ : packet),
- QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
- ? arraysize(packet_cid_be)
- : arraysize(packet));
- }
+ QuicUtils::IsConnectionIdWireFormatBigEndian(framer_.perspective())
+ ? arraysize(packet_cid_be)
+ : arraysize(packet));
}
TEST_P(QuicFramerTest, EncryptPacket) {
« no previous file with comments | « net/quic/core/quic_framer.cc ('k') | net/quic/core/quic_packets.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698