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

Side by Side Diff: net/tools/quic/end_to_end_test.cc

Issue 2241183004: Landing Recent QUIC changes until Sat Aug 13 04:32:36 2016 UTC-0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compiler error. Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/quic_client_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 ReliableQuicStreamPeer::SetStreamBytesWritten(3, stream); 1194 ReliableQuicStreamPeer::SetStreamBytesWritten(3, stream);
1188 1195
1189 client_->SendData("bar", true); 1196 client_->SendData("bar", true);
1190 client_->WaitForWriteToFlush(); 1197 client_->WaitForWriteToFlush();
1191 1198
1192 // By default the stream protects itself from writes after terminte is set. 1199 // By default the stream protects itself from writes after terminte is set.
1193 // Override this to test the server handling buggy clients. 1200 // Override this to test the server handling buggy clients.
1194 ReliableQuicStreamPeer::SetWriteSideClosed(false, 1201 ReliableQuicStreamPeer::SetWriteSideClosed(false,
1195 client_->GetOrCreateStream()); 1202 client_->GetOrCreateStream());
1196 1203
1197 EXPECT_DFATAL(client_->SendData("eep", true), "Fin already buffered"); 1204 EXPECT_QUIC_BUG(client_->SendData("eep", true), "Fin already buffered");
1198 } 1205 }
1199 1206
1200 TEST_P(EndToEndTest, Timeout) { 1207 TEST_P(EndToEndTest, Timeout) {
1201 client_config_.SetIdleConnectionStateLifetime( 1208 client_config_.SetIdleConnectionStateLifetime(
1202 QuicTime::Delta::FromMicroseconds(500), 1209 QuicTime::Delta::FromMicroseconds(500),
1203 QuicTime::Delta::FromMicroseconds(500)); 1210 QuicTime::Delta::FromMicroseconds(500));
1204 // Note: we do NOT ASSERT_TRUE: we may time out during initial handshake: 1211 // Note: we do NOT ASSERT_TRUE: we may time out during initial handshake:
1205 // that's enough to validate timeout in this case. 1212 // that's enough to validate timeout in this case.
1206 Initialize(); 1213 Initialize();
1207 while (client_->client()->connected()) { 1214 while (client_->client()->connected()) {
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/quic_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698