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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 net::IPAddressNumber ip; | 190 net::IPAddressNumber ip; |
191 CHECK(net::ParseIPLiteralToNumber("127.0.0.1", &ip)); | 191 CHECK(net::ParseIPLiteralToNumber("127.0.0.1", &ip)); |
192 server_address_ = IPEndPoint(ip, 0); | 192 server_address_ = IPEndPoint(ip, 0); |
193 | 193 |
194 client_supported_versions_ = GetParam().client_supported_versions; | 194 client_supported_versions_ = GetParam().client_supported_versions; |
195 server_supported_versions_ = GetParam().server_supported_versions; | 195 server_supported_versions_ = GetParam().server_supported_versions; |
196 negotiated_version_ = GetParam().negotiated_version; | 196 negotiated_version_ = GetParam().negotiated_version; |
197 FLAGS_enable_quic_pacing = GetParam().use_pacing; | 197 FLAGS_enable_quic_pacing = GetParam().use_pacing; |
198 FLAGS_enable_quic_fec = GetParam().use_fec; | 198 FLAGS_enable_quic_fec = GetParam().use_fec; |
199 | 199 |
200 if (negotiated_version_ >= QUIC_VERSION_19) { | |
201 FLAGS_enable_quic_connection_flow_control_2 = true; | |
202 } | |
203 VLOG(1) << "Using Configuration: " << GetParam(); | 200 VLOG(1) << "Using Configuration: " << GetParam(); |
204 | 201 |
205 client_config_.SetDefaults(); | 202 client_config_.SetDefaults(); |
206 server_config_.SetDefaults(); | 203 server_config_.SetDefaults(); |
207 | 204 |
208 // Use different flow control windows for client/server. | 205 // Use different flow control windows for client/server. |
209 client_config_.SetInitialFlowControlWindowToSend( | 206 client_config_.SetInitialFlowControlWindowToSend( |
210 2 * kInitialSessionFlowControlWindowForTest); | 207 2 * kInitialSessionFlowControlWindowForTest); |
211 client_config_.SetInitialStreamFlowControlWindowToSend( | 208 client_config_.SetInitialStreamFlowControlWindowToSend( |
212 2 * kInitialStreamFlowControlWindowForTest); | 209 2 * kInitialStreamFlowControlWindowForTest); |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 client_->SendSynchronousRequest("/bar"); | 1155 client_->SendSynchronousRequest("/bar"); |
1159 | 1156 |
1160 EXPECT_EQ(QUIC_STREAM_CONNECTION_ERROR, client_->stream_error()); | 1157 EXPECT_EQ(QUIC_STREAM_CONNECTION_ERROR, client_->stream_error()); |
1161 EXPECT_EQ(QUIC_ERROR_MIGRATING_ADDRESS, client_->connection_error()); | 1158 EXPECT_EQ(QUIC_ERROR_MIGRATING_ADDRESS, client_->connection_error()); |
1162 } | 1159 } |
1163 | 1160 |
1164 TEST_P(EndToEndTest, ConnectionMigrationClientPortChanged) { | 1161 TEST_P(EndToEndTest, ConnectionMigrationClientPortChanged) { |
1165 // 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 |
1166 // 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 |
1167 // closed by the server. | 1164 // closed by the server. |
1168 FLAGS_quic_allow_port_migration = true; | |
1169 | |
1170 ASSERT_TRUE(Initialize()); | 1165 ASSERT_TRUE(Initialize()); |
1171 | 1166 |
1172 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); | 1167 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); |
1173 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); | 1168 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); |
1174 | 1169 |
1175 // 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. |
1176 IPEndPoint old_address = client_->client()->client_address(); | 1171 IPEndPoint old_address = client_->client()->client_address(); |
1177 | 1172 |
1178 // Stop listening on the old FD. | 1173 // Stop listening on the old FD. |
1179 EpollServer* eps = client_->epoll_server(); | 1174 EpollServer* eps = client_->epoll_server(); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1384 QuicSession* session = dispatcher->session_map().begin()->second; | 1379 QuicSession* session = dispatcher->session_map().begin()->second; |
1385 EXPECT_EQ(0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset( | 1380 EXPECT_EQ(0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset( |
1386 session).size()); | 1381 session).size()); |
1387 server_thread_->Resume(); | 1382 server_thread_->Resume(); |
1388 } | 1383 } |
1389 | 1384 |
1390 } // namespace | 1385 } // namespace |
1391 } // namespace test | 1386 } // namespace test |
1392 } // namespace tools | 1387 } // namespace tools |
1393 } // namespace net | 1388 } // namespace net |
OLD | NEW |