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 <sys/epoll.h> | 6 #include <sys/epoll.h> |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // Run tests with no options, a single option, or all the | 228 // Run tests with no options, a single option, or all the |
229 // options enabled to avoid a combinatorial explosion. | 229 // options enabled to avoid a combinatorial explosion. |
230 if (enabled_options > 1 && | 230 if (enabled_options > 1 && |
231 enabled_options < kMaxEnabledOptions) { | 231 enabled_options < kMaxEnabledOptions) { |
232 continue; | 232 continue; |
233 } | 233 } |
234 | 234 |
235 for (const QuicVersionVector& client_versions : | 235 for (const QuicVersionVector& client_versions : |
236 version_buckets) { | 236 version_buckets) { |
237 CHECK(!client_versions.empty()); | 237 CHECK(!client_versions.empty()); |
| 238 if (FilterSupportedVersions(client_versions).empty()) { |
| 239 continue; |
| 240 } |
238 // Add an entry for server and client supporting all versions. | 241 // Add an entry for server and client supporting all versions. |
239 params.push_back(TestParams( | 242 params.push_back(TestParams( |
240 client_versions, all_supported_versions, | 243 client_versions, all_supported_versions, |
241 client_versions.front(), | 244 client_versions.front(), |
242 client_supports_stateless_rejects, | 245 client_supports_stateless_rejects, |
243 server_uses_stateless_rejects_if_peer_supported, | 246 server_uses_stateless_rejects_if_peer_supported, |
244 congestion_control_tag, disable_hpack_dynamic_table, | 247 congestion_control_tag, disable_hpack_dynamic_table, |
245 force_hol_blocking, use_cheap_stateless_reject, | 248 force_hol_blocking, use_cheap_stateless_reject, |
246 buffer_packet_till_chlo)); | 249 buffer_packet_till_chlo)); |
247 | 250 |
248 // Run version negotiation tests tests with no options, or all | 251 // Run version negotiation tests tests with no options, or all |
249 // the options enabled to avoid a combinatorial explosion. | 252 // the options enabled to avoid a combinatorial explosion. |
250 if (enabled_options > 0 && | 253 if (enabled_options > 0 && |
251 enabled_options < kMaxEnabledOptions) { | 254 enabled_options < kMaxEnabledOptions) { |
252 continue; | 255 continue; |
253 } | 256 } |
254 | 257 |
255 // Test client supporting all versions and server supporting 1 | 258 // Test client supporting all versions and server supporting 1 |
256 // version. Simulate an old server and exercise version | 259 // version. Simulate an old server and exercise version |
257 // downgrade in the client. Protocol negotiation should occur. | 260 // downgrade in the client. Protocol negotiation should occur. |
258 // Skip the i = 0 case because it is essentially the same as | 261 // Skip the i = 0 case because it is essentially the same as |
259 // the default case. | 262 // the default case. |
260 for (size_t i = 1; i < client_versions.size(); ++i) { | 263 for (size_t i = 1; i < client_versions.size(); ++i) { |
261 QuicVersionVector server_supported_versions; | 264 QuicVersionVector server_supported_versions; |
262 server_supported_versions.push_back(client_versions[i]); | 265 server_supported_versions.push_back(client_versions[i]); |
| 266 if (FilterSupportedVersions(server_supported_versions) |
| 267 .empty()) { |
| 268 continue; |
| 269 } |
263 params.push_back(TestParams( | 270 params.push_back(TestParams( |
264 client_versions, server_supported_versions, | 271 client_versions, server_supported_versions, |
265 server_supported_versions.front(), | 272 server_supported_versions.front(), |
266 client_supports_stateless_rejects, | 273 client_supports_stateless_rejects, |
267 server_uses_stateless_rejects_if_peer_supported, | 274 server_uses_stateless_rejects_if_peer_supported, |
268 congestion_control_tag, disable_hpack_dynamic_table, | 275 congestion_control_tag, disable_hpack_dynamic_table, |
269 force_hol_blocking, use_cheap_stateless_reject, | 276 force_hol_blocking, use_cheap_stateless_reject, |
270 buffer_packet_till_chlo)); | 277 buffer_packet_till_chlo)); |
271 } // End of version for loop. | 278 } // End of version for loop. |
272 } // End of 2nd version for loop. | 279 } // End of 2nd version for loop. |
(...skipping 2603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2876 EXPECT_EQ(kBarResponseBody, client_->response_body()); | 2883 EXPECT_EQ(kBarResponseBody, client_->response_body()); |
2877 QuicConnectionStats client_stats = | 2884 QuicConnectionStats client_stats = |
2878 client_->client()->session()->connection()->GetStats(); | 2885 client_->client()->session()->connection()->GetStats(); |
2879 EXPECT_EQ(0u, client_stats.packets_lost); | 2886 EXPECT_EQ(0u, client_stats.packets_lost); |
2880 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); | 2887 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); |
2881 } | 2888 } |
2882 | 2889 |
2883 } // namespace | 2890 } // namespace |
2884 } // namespace test | 2891 } // namespace test |
2885 } // namespace net | 2892 } // namespace net |
OLD | NEW |