Index: net/quic/quic_connection_test.cc |
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc |
index c16ddabda229fd1612676bab3808822e0fa363f4..2f06d7199d16f982d231f6bf50c1c427df5adc96 100644 |
--- a/net/quic/quic_connection_test.cc |
+++ b/net/quic/quic_connection_test.cc |
@@ -5572,6 +5572,32 @@ TEST_P(QuicConnectionTest, SendingUnencryptedStreamDataFails) { |
EXPECT_FALSE(connection_.connected()); |
} |
+TEST_P(QuicConnectionTest, EnableMultipathNegotiation) { |
+ // Test multipath negotiation during crypto handshake. Multipath is enabled |
+ // when both endpoints enable multipath. |
+ ValueRestore<bool> old_flag(&FLAGS_quic_enable_multipath, true); |
+ EXPECT_TRUE(connection_.connected()); |
+ EXPECT_FALSE(QuicConnectionPeer::IsMultipathEnabled(&connection_)); |
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); |
+ QuicConfig config; |
+ // Enable multipath on server side. |
+ config.SetMultipathEnabled(true); |
+ |
+ // Create a handshake message enables multipath. |
+ CryptoHandshakeMessage msg; |
+ string error_details; |
+ QuicConfig client_config; |
+ // Enable multipath on client side. |
+ client_config.SetMultipathEnabled(true); |
+ client_config.ToHandshakeMessage(&msg); |
+ const QuicErrorCode error = |
+ config.ProcessPeerHello(msg, CLIENT, &error_details); |
+ EXPECT_EQ(QUIC_NO_ERROR, error); |
+ |
+ connection_.SetFromConfig(config); |
+ EXPECT_TRUE(QuicConnectionPeer::IsMultipathEnabled(&connection_)); |
+} |
+ |
} // namespace |
} // namespace test |
} // namespace net |