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

Side by Side Diff: tests/standalone/io/http_response_deadline_test.dart

Issue 311513002: Enable throttleing of HttpClient per host, with default being 6. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 Future.wait(futures).then((_) => server.close()); 53 Future.wait(futures).then((_) => server.close());
54 }); 54 });
55 } 55 }
56 56
57 void testDeadlineAndDetach(int connections) { 57 void testDeadlineAndDetach(int connections) {
58 HttpServer.bind('localhost', 0).then((server) { 58 HttpServer.bind('localhost', 0).then((server) {
59 server.listen((request) { 59 server.listen((request) {
60 request.response.deadline = const Duration(milliseconds: 0); 60 request.response.deadline = const Duration(milliseconds: 0);
61 request.response.contentLength = 5; 61 request.response.contentLength = 5;
62 request.response.persistentConnection = false;
62 request.response.detachSocket().then((socket) { 63 request.response.detachSocket().then((socket) {
63 new Timer(const Duration(milliseconds: 100), () { 64 new Timer(const Duration(milliseconds: 100), () {
64 socket.write('stuff'); 65 socket.write('stuff');
65 socket.close(); 66 socket.close();
66 socket.listen(null); 67 socket.listen(null);
67 }); 68 });
68 }); 69 });
69 }); 70 });
70 71
71 var futures = []; 72 var futures = [];
(...skipping 12 matching lines...) Expand all
84 Future.wait(futures).then((_) => server.close()); 85 Future.wait(futures).then((_) => server.close());
85 }); 86 });
86 } 87 }
87 88
88 void main() { 89 void main() {
89 testSimpleDeadline(10); 90 testSimpleDeadline(10);
90 testExceedDeadline(10); 91 testExceedDeadline(10);
91 testDeadlineAndDetach(10); 92 testDeadlineAndDetach(10);
92 } 93 }
93 94
OLDNEW
« no previous file with comments | « tests/standalone/io/http_client_connect_test.dart ('k') | tests/standalone/io/http_shutdown_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698