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

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

Issue 11411121: Generate an error for active connections when the HTTP client is shutdown (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed long line Created 8 years, 1 month 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_content_length_test.dart
diff --git a/tests/standalone/io/http_content_length_test.dart b/tests/standalone/io/http_content_length_test.dart
index 917b014c1de1c632c82e5af6eedd38c345f6af35..47ef94166916fcfcc8ce7d344f40c9c0db054aab 100644
--- a/tests/standalone/io/http_content_length_test.dart
+++ b/tests/standalone/io/http_content_length_test.dart
@@ -38,10 +38,13 @@ void testNoBody(int totalConnections, bool explicitContentLength) {
Expect.equals("0", response.headers.value('content-length'));
Expect.equals(0, response.contentLength);
count++;
- if (count == totalConnections) {
- client.shutdown();
- server.close();
- }
+ response.inputStream.onData = response.inputStream.read;
+ response.inputStream.onClosed = () {
+ if (count == totalConnections) {
+ client.shutdown();
+ server.close();
+ }
+ };
};
}
}
@@ -82,10 +85,13 @@ void testBody(int totalConnections) {
Expect.equals("2", response.headers.value('content-length'));
Expect.equals(2, response.contentLength);
count++;
- if (count == totalConnections) {
- client.shutdown();
- server.close();
- }
+ response.inputStream.onData = response.inputStream.read;
+ response.inputStream.onClosed = () {
+ if (count == totalConnections) {
+ client.shutdown();
+ server.close();
+ }
+ };
};
}
}

Powered by Google App Engine
This is Rietveld 408576698