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 <stddef.h> | 5 #include <stddef.h> |
6 #include <string> | 6 #include <string> |
7 #include <sys/epoll.h> | 7 #include <sys/epoll.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 client_->SendSynchronousRequest("/bar"); | 1155 client_->SendSynchronousRequest("/bar"); |
1156 | 1156 |
1157 EXPECT_EQ(QUIC_STREAM_CONNECTION_ERROR, client_->stream_error()); | 1157 EXPECT_EQ(QUIC_STREAM_CONNECTION_ERROR, client_->stream_error()); |
1158 EXPECT_EQ(QUIC_ERROR_MIGRATING_ADDRESS, client_->connection_error()); | 1158 EXPECT_EQ(QUIC_ERROR_MIGRATING_ADDRESS, client_->connection_error()); |
1159 } | 1159 } |
1160 | 1160 |
1161 TEST_P(EndToEndTest, ConnectionMigrationClientPortChanged) { | 1161 TEST_P(EndToEndTest, ConnectionMigrationClientPortChanged) { |
1162 // Tests that the client's port can change during an established QUIC | 1162 // Tests that the client's port can change during an established QUIC |
1163 // connection, and that doing so does not result in the connection being | 1163 // connection, and that doing so does not result in the connection being |
1164 // closed by the server. | 1164 // closed by the server. |
1165 FLAGS_quic_allow_port_migration = true; | |
1166 | |
1167 ASSERT_TRUE(Initialize()); | 1165 ASSERT_TRUE(Initialize()); |
1168 | 1166 |
1169 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); | 1167 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); |
1170 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); | 1168 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); |
1171 | 1169 |
1172 // Store the client address which was used to send the first request. | 1170 // Store the client address which was used to send the first request. |
1173 IPEndPoint old_address = client_->client()->client_address(); | 1171 IPEndPoint old_address = client_->client()->client_address(); |
1174 | 1172 |
1175 // Stop listening on the old FD. | 1173 // Stop listening on the old FD. |
1176 EpollServer* eps = client_->epoll_server(); | 1174 EpollServer* eps = client_->epoll_server(); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 QuicSession* session = dispatcher->session_map().begin()->second; | 1379 QuicSession* session = dispatcher->session_map().begin()->second; |
1382 EXPECT_EQ(0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset( | 1380 EXPECT_EQ(0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset( |
1383 session).size()); | 1381 session).size()); |
1384 server_thread_->Resume(); | 1382 server_thread_->Resume(); |
1385 } | 1383 } |
1386 | 1384 |
1387 } // namespace | 1385 } // namespace |
1388 } // namespace test | 1386 } // namespace test |
1389 } // namespace tools | 1387 } // namespace tools |
1390 } // namespace net | 1388 } // namespace net |
OLD | NEW |