OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/core/quic_connection.h" | 5 #include "net/quic/core/quic_connection.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <memory> | 8 #include <memory> |
9 #include <ostream> | 9 #include <ostream> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 kPeerAddress); | 1158 kPeerAddress); |
1159 // Cause change in self_address. | 1159 // Cause change in self_address. |
1160 IPEndPoint self_address(IPAddress(1, 1, 1, 1), 123); | 1160 IPEndPoint self_address(IPAddress(1, 1, 1, 1), 123); |
1161 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_ERROR_MIGRATING_ADDRESS, _, _)); | 1161 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_ERROR_MIGRATING_ADDRESS, _, _)); |
1162 ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address, | 1162 ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address, |
1163 kPeerAddress); | 1163 kPeerAddress); |
1164 EXPECT_FALSE(connection_.connected()); | 1164 EXPECT_FALSE(connection_.connected()); |
1165 } | 1165 } |
1166 | 1166 |
1167 TEST_P(QuicConnectionTest, AllowSelfAddressChangeToMappedIpv4AddressAtServer) { | 1167 TEST_P(QuicConnectionTest, AllowSelfAddressChangeToMappedIpv4AddressAtServer) { |
1168 FLAGS_quic_allow_server_address_change_for_mapped_ipv4 = true; | |
1169 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); | 1168 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); |
1170 | 1169 |
1171 set_perspective(Perspective::IS_SERVER); | 1170 set_perspective(Perspective::IS_SERVER); |
1172 QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false); | 1171 QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false); |
1173 | 1172 |
1174 EXPECT_EQ(Perspective::IS_SERVER, connection_.perspective()); | 1173 EXPECT_EQ(Perspective::IS_SERVER, connection_.perspective()); |
1175 EXPECT_TRUE(connection_.connected()); | 1174 EXPECT_TRUE(connection_.connected()); |
1176 | 1175 |
1177 QuicStreamFrame stream_frame(1u, false, 0u, StringPiece()); | 1176 QuicStreamFrame stream_frame(1u, false, 0u, StringPiece()); |
1178 EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(3); | 1177 EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(3); |
(...skipping 4101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5280 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr); | 5279 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr); |
5281 EXPECT_EQ(1u, writer_->frame_count()); | 5280 EXPECT_EQ(1u, writer_->frame_count()); |
5282 EXPECT_FALSE(writer_->connection_close_frames().empty()); | 5281 EXPECT_FALSE(writer_->connection_close_frames().empty()); |
5283 // Ack frame is not bundled in connection close packet. | 5282 // Ack frame is not bundled in connection close packet. |
5284 EXPECT_TRUE(writer_->ack_frames().empty()); | 5283 EXPECT_TRUE(writer_->ack_frames().empty()); |
5285 } | 5284 } |
5286 | 5285 |
5287 } // namespace | 5286 } // namespace |
5288 } // namespace test | 5287 } // namespace test |
5289 } // namespace net | 5288 } // namespace net |
OLD | NEW |