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

Unified Diff: net/quic/quic_packet_creator_test.cc

Issue 1904213002: QUIC: support diversified keys with version 33. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hkdf
Patch Set: Rebase Created 4 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/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_creator_test.cc
diff --git a/net/quic/quic_packet_creator_test.cc b/net/quic/quic_packet_creator_test.cc
index 9731eba2bf52192d3705f43c7159018d2c6b6268..b6c17f4c7e6dd0a9a00fd2489236fbb176e1cd19 100644
--- a/net/quic/quic_packet_creator_test.cc
+++ b/net/quic/quic_packet_creator_test.cc
@@ -62,19 +62,15 @@ struct TestParams {
// Constructs various test permutations.
vector<TestParams> GetTestParams() {
vector<TestParams> params;
- QuicConnectionIdLength max = PACKET_8BYTE_CONNECTION_ID;
+ constexpr QuicConnectionIdLength kMax = PACKET_8BYTE_CONNECTION_ID;
QuicVersionVector all_supported_versions = QuicSupportedVersions();
for (size_t i = 0; i < all_supported_versions.size(); ++i) {
- params.push_back(TestParams(all_supported_versions[i], true, max));
- params.push_back(TestParams(all_supported_versions[i], false, max));
+ params.push_back(TestParams(all_supported_versions[i], true, kMax));
+ params.push_back(TestParams(all_supported_versions[i], false, kMax));
}
params.push_back(
TestParams(all_supported_versions[0], true, PACKET_0BYTE_CONNECTION_ID));
- params.push_back(
- TestParams(all_supported_versions[0], true, PACKET_1BYTE_CONNECTION_ID));
- params.push_back(
- TestParams(all_supported_versions[0], true, PACKET_4BYTE_CONNECTION_ID));
- params.push_back(TestParams(all_supported_versions[0], true, max));
+ params.push_back(TestParams(all_supported_versions[0], true, kMax));
return params;
}
@@ -185,6 +181,7 @@ class QuicPacketCreatorTest : public ::testing::TestWithParam<TestParams> {
size_t GetPacketHeaderOverhead() {
return GetPacketHeaderSize(
creator_.connection_id_length(), kIncludeVersion, !kIncludePathId,
+ !kIncludeDiversificationNonce,
QuicPacketCreatorPeer::NextPacketNumberLength(&creator_));
}
@@ -819,8 +816,8 @@ TEST_P(QuicPacketCreatorTest, ConsumeDataLargerThanOneStreamFrame) {
client_framer_.version(),
QuicPacketCreatorPeer::SendVersionInPacket(&creator_),
QuicPacketCreatorPeer::SendPathIdInPacket(&creator_),
- creator_.connection_id_length(), PACKET_1BYTE_PACKET_NUMBER,
- &payload_length));
+ !kIncludeDiversificationNonce, creator_.connection_id_length(),
+ PACKET_1BYTE_PACKET_NUMBER, &payload_length));
QuicFrame frame;
const string too_long_payload(payload_length * 2, 'a');
QuicIOVector io_vector(MakeIOVector(too_long_payload));
@@ -848,7 +845,7 @@ TEST_P(QuicPacketCreatorTest, AddFrameAndFlush) {
creator_.connection_id_length(),
QuicPacketCreatorPeer::SendVersionInPacket(&creator_),
QuicPacketCreatorPeer::SendPathIdInPacket(&creator_),
- PACKET_1BYTE_PACKET_NUMBER),
+ !kIncludeDiversificationNonce, PACKET_1BYTE_PACKET_NUMBER),
creator_.BytesFree());
// Add a variety of frame types and then a padding frame.
@@ -889,7 +886,8 @@ TEST_P(QuicPacketCreatorTest, AddFrameAndFlush) {
GetPacketHeaderSize(
creator_.connection_id_length(),
QuicPacketCreatorPeer::SendVersionInPacket(&creator_),
- /*include_path_id=*/false, PACKET_1BYTE_PACKET_NUMBER),
+ /*include_path_id=*/false, !kIncludeDiversificationNonce,
+ PACKET_1BYTE_PACKET_NUMBER),
creator_.BytesFree());
}
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698