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

Unified Diff: tests/standalone/io/http_connection_close_test.dart

Issue 12655003: Buffer the entire http header to one packet, and buffer other data in chunks of 4-16 kb. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: tests/standalone/io/http_connection_close_test.dart
diff --git a/tests/standalone/io/http_connection_close_test.dart b/tests/standalone/io/http_connection_close_test.dart
index 7bc03838462c94a00be55b6985620aba5d4f70d4..c3147f5788b91573f105e00ccdf9d2fc53771a86 100644
--- a/tests/standalone/io/http_connection_close_test.dart
+++ b/tests/standalone/io/http_connection_close_test.dart
@@ -51,11 +51,15 @@ void testHttp11Close(bool closeRequest) {
void testStreamResponse() {
HttpServer.bind().then((server) {
server.listen((request) {
- // TODO(ajohnsen): Use timer (see old version).
- for (int i = 0; i < 10; i++) {
+ var timer = new Timer.repeating(const Duration(milliseconds: 0), (_) {
request.response.write(
'data:${new DateTime.now().millisecondsSinceEpoch}\n\n');
- }
+ });
+ request.response.done
+ .whenComplete(() {
+ timer.cancel();
+ })
+ .catchError((_) {});
});
var client = new HttpClient();
« no previous file with comments | « tests/standalone/io/http_client_request_test.dart ('k') | tests/standalone/io/http_content_length_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698