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

Unified Diff: net/tools/quic/quic_dispatcher_test.cc

Issue 2809773002: Add QUIC v39 which will be used to experiment with HTTP/2 stream... (Closed)
Patch Set: 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_versions.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher_test.cc
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc
index a4a7f23865776d34a1bc28c2ea9e2f5910245170..6e7a4172d2cd6948a92a927d5b2db16d4bca5d02 100644
--- a/net/tools/quic/quic_dispatcher_test.cc
+++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -527,12 +527,13 @@ TEST_F(QuicDispatcherTest, TooBigSeqNoPacketToTimeWaitListManager) {
}
TEST_F(QuicDispatcherTest, SupportedVersionsChangeInFlight) {
- static_assert(arraysize(kSupportedQuicVersions) == 5u,
+ static_assert(arraysize(kSupportedQuicVersions) == 6u,
"Supported versions out of sync");
FLAGS_quic_reloadable_flag_quic_disable_version_34 = false;
FLAGS_quic_reloadable_flag_quic_enable_version_36_v3 = true;
FLAGS_quic_reloadable_flag_quic_enable_version_37 = true;
FLAGS_quic_reloadable_flag_quic_enable_version_38 = true;
+ base::SetFlag(&FLAGS_quic_enable_version_39, true);
QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
server_address_ = QuicSocketAddress(QuicIpAddress::Any4(), 5);
QuicConnectionId connection_id = 1;
@@ -570,6 +571,33 @@ TEST_F(QuicDispatcherTest, SupportedVersionsChangeInFlight) {
ProcessPacket(client_address, connection_id, true, QuicVersionMax(),
SerializeCHLO(), PACKET_8BYTE_CONNECTION_ID,
PACKET_6BYTE_PACKET_NUMBER, 1);
+
+ // Turn off version 39.
+ base::SetFlag(&FLAGS_quic_enable_version_39, false);
+ ++connection_id;
+ EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address))
+ .Times(0);
+ ProcessPacket(client_address, connection_id, true, QUIC_VERSION_39,
+ SerializeCHLO(), PACKET_8BYTE_CONNECTION_ID,
+ PACKET_6BYTE_PACKET_NUMBER, 1);
+
+ // Turn on version 39.
+ base::SetFlag(&FLAGS_quic_enable_version_39, true);
+ ++connection_id;
+ EXPECT_CALL(*dispatcher_, CreateQuicSession(connection_id, client_address))
+ .WillOnce(testing::Return(CreateSession(
+ dispatcher_.get(), config_, connection_id, client_address,
+ &mock_helper_, &mock_alarm_factory_, &crypto_config_,
+ QuicDispatcherPeer::GetCache(dispatcher_.get()), &session1_)));
+ EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()),
+ ProcessUdpPacket(_, _, _))
+ .WillOnce(testing::WithArgs<2>(
+ Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
+ base::Unretained(this), connection_id))));
+ ProcessPacket(client_address, connection_id, true, QUIC_VERSION_39,
+ SerializeCHLO(), PACKET_8BYTE_CONNECTION_ID,
+ PACKET_6BYTE_PACKET_NUMBER, 1);
+
// Turn off version 36.
FLAGS_quic_reloadable_flag_quic_enable_version_36_v3 = false;
++connection_id;
« no previous file with comments | « net/quic/core/quic_versions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698