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

Unified Diff: net/quic/core/quic_connection_test.cc

Issue 2330033002: Merge internal change: 132864057 (Closed)
Patch Set: re-sync Created 4 years, 3 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_connection.cc ('k') | net/quic/core/quic_flags_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_connection_test.cc
diff --git a/net/quic/core/quic_connection_test.cc b/net/quic/core/quic_connection_test.cc
index 4225d3dac31e79a8a9e662768b7e94c9383317da..e70cf22d6a8666dfadfd2c7146ae982d9a9fed39 100644
--- a/net/quic/core/quic_connection_test.cc
+++ b/net/quic/core/quic_connection_test.cc
@@ -1140,6 +1140,33 @@ TEST_P(QuicConnectionTest, SelfAddressChangeAtServer) {
EXPECT_FALSE(connection_.connected());
}
+TEST_P(QuicConnectionTest, AllowSelfAddressChangeToMappedIpv4AddressAtServer) {
+ FLAGS_quic_allow_server_address_change_for_mapped_ipv4 = true;
+ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
+
+ set_perspective(Perspective::IS_SERVER);
+ QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false);
+
+ EXPECT_EQ(Perspective::IS_SERVER, connection_.perspective());
+ EXPECT_TRUE(connection_.connected());
+
+ QuicStreamFrame stream_frame(1u, false, 0u, StringPiece());
+ EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(3);
+ IPEndPoint self_address1(IPAddress(1, 1, 1, 1), 443);
+ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address1,
+ kPeerAddress);
+ // Cause self_address change to mapped Ipv4 address.
+ IPEndPoint self_address2(ConvertIPv4ToIPv4MappedIPv6(self_address1.address()),
+ 443);
+ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address2,
+ kPeerAddress);
+ EXPECT_TRUE(connection_.connected());
+ // self_address change back to Ipv4 address.
+ ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address1,
+ kPeerAddress);
+ EXPECT_TRUE(connection_.connected());
+}
+
TEST_P(QuicConnectionTest, ClientAddressChangeAndPacketReordered) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
set_perspective(Perspective::IS_SERVER);
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_flags_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698