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

Unified Diff: net/quic/quic_packet_generator_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_generator.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_generator_test.cc
diff --git a/net/quic/quic_packet_generator_test.cc b/net/quic/quic_packet_generator_test.cc
index e1d7b1ec2ac2144970b37505e724bb0adf953ad0..a9aa5d02cc2cb12c34fd3cd1cee93583033b1243 100644
--- a/net/quic/quic_packet_generator_test.cc
+++ b/net/quic/quic_packet_generator_test.cc
@@ -450,6 +450,7 @@ TEST_F(QuicPacketGeneratorTest, ConsumeData_FramesPreviouslyQueued) {
NullEncrypter().GetCiphertextSize(0) +
GetPacketHeaderSize(
creator_->connection_id_length(), kIncludeVersion, !kIncludePathId,
+ !kIncludeDiversificationNonce,
QuicPacketCreatorPeer::NextPacketNumberLength(creator_)) +
// Add an extra 3 bytes for the payload and 1 byte so BytesFree is larger
// than the GetMinStreamFrameSize.
@@ -575,24 +576,11 @@ TEST_F(QuicPacketGeneratorTest, NotWritableThenBatchOperations2) {
TEST_F(QuicPacketGeneratorTest, TestConnectionIdLength) {
generator_.SetConnectionIdLength(0);
EXPECT_EQ(PACKET_0BYTE_CONNECTION_ID, creator_->connection_id_length());
- generator_.SetConnectionIdLength(1);
- EXPECT_EQ(PACKET_1BYTE_CONNECTION_ID, creator_->connection_id_length());
- generator_.SetConnectionIdLength(2);
- EXPECT_EQ(PACKET_4BYTE_CONNECTION_ID, creator_->connection_id_length());
- generator_.SetConnectionIdLength(3);
- EXPECT_EQ(PACKET_4BYTE_CONNECTION_ID, creator_->connection_id_length());
- generator_.SetConnectionIdLength(4);
- EXPECT_EQ(PACKET_4BYTE_CONNECTION_ID, creator_->connection_id_length());
- generator_.SetConnectionIdLength(5);
- EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
- generator_.SetConnectionIdLength(6);
- EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
- generator_.SetConnectionIdLength(7);
- EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
- generator_.SetConnectionIdLength(8);
- EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
- generator_.SetConnectionIdLength(9);
- EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
+
+ for (size_t i = 1; i < 10; i++) {
+ generator_.SetConnectionIdLength(i);
+ EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
+ }
}
// Test whether SetMaxPacketLength() works in the situation when the queue is
« no previous file with comments | « net/quic/quic_packet_generator.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698