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

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

Issue 11886046: Fix a test which needed an error handler after r17064 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b6116d2598149754bddb9e55830d1905022ae01f..67106e61a403b307af16bc0870440c7e102cff82 100644
--- a/tests/standalone/io/http_connection_close_test.dart
+++ b/tests/standalone/io/http_connection_close_test.dart
@@ -43,16 +43,21 @@ void testHttp11Close(bool closeRequest) {
}
void testStreamResponse() {
+ Timer timer;
var server = new HttpServer();
+ server.onError = (e) {
+ server.close();
+ timer.cancel();
+ };
server.listen("127.0.0.1", 0, backlog: 5);
server.defaultRequestHandler = (var request, var response) {
- new Timer.repeating(10, (x) {
+ timer = new Timer.repeating(10, (_) {
Date now = new Date.now();
try {
response.outputStream.writeString(
'data:${now.millisecondsSinceEpoch}\n\n');
} catch (e) {
- x.cancel();
+ timer.cancel();
server.close();
}
});
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698