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

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

Issue 12793003: Rename Timer.repeating to Timer.periodic. (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 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 5
6 import "dart:async"; 6 import "dart:async";
7 import "dart:io"; 7 import "dart:io";
8 import "dart:uri"; 8 import "dart:uri";
9 9
10 void testHttp10Close(bool closeRequest) { 10 void testHttp10Close(bool closeRequest) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 server.close(); 44 server.close();
45 }); 45 });
46 if (closeRequest) socket.close(); 46 if (closeRequest) socket.close();
47 }); 47 });
48 }); 48 });
49 } 49 }
50 50
51 void testStreamResponse() { 51 void testStreamResponse() {
52 HttpServer.bind().then((server) { 52 HttpServer.bind().then((server) {
53 server.listen((request) { 53 server.listen((request) {
54 var timer = new Timer.repeating(const Duration(milliseconds: 0), (_) { 54 var timer = new Timer.periodic(const Duration(milliseconds: 0), (_) {
55 request.response.write( 55 request.response.write(
56 'data:${new DateTime.now().millisecondsSinceEpoch}\n\n'); 56 'data:${new DateTime.now().millisecondsSinceEpoch}\n\n');
57 }); 57 });
58 request.response.done 58 request.response.done
59 .whenComplete(() { 59 .whenComplete(() {
60 timer.cancel(); 60 timer.cancel();
61 }) 61 })
62 .catchError((_) {}); 62 .catchError((_) {});
63 }); 63 });
64 64
(...skipping 16 matching lines...) Expand all
81 }); 81 });
82 } 82 }
83 83
84 main() { 84 main() {
85 testHttp10Close(false); 85 testHttp10Close(false);
86 testHttp10Close(true); 86 testHttp10Close(true);
87 testHttp11Close(false); 87 testHttp11Close(false);
88 testHttp11Close(true); 88 testHttp11Close(true);
89 testStreamResponse(); 89 testStreamResponse();
90 } 90 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698