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

Unified Diff: net/quic/quic_packet_generator_test.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 190e8a7d2561896b563757c16edddda7334b604a..8ffa34b5295122eab16c2fab3a1a4b7410c1e6c5 100644
--- a/net/quic/quic_packet_generator_test.cc
+++ b/net/quic/quic_packet_generator_test.cc
@@ -953,5 +953,28 @@ TEST_F(QuicPacketGeneratorTest, NotWritableThenBatchOperations2) {
CheckPacketContains(contents2, packet2_);
}
+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());
+}
+
} // namespace test
} // namespace net
« 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