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

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

Issue 11606020: Reapply "Fixes to eventhandler and HTTP"" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove invalid assert (fixes Windows test) Created 8 years 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 | « sdk/lib/io/socket_stream_impl.dart ('k') | 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_shutdown_test.dart
diff --git a/tests/standalone/io/http_shutdown_test.dart b/tests/standalone/io/http_shutdown_test.dart
index c7e3bbef5ec972b6e4aaa8fb6b7bb66e4792d1cb..077eb83b133b19b76a3d8efe6af456d154a60d77 100644
--- a/tests/standalone/io/http_shutdown_test.dart
+++ b/tests/standalone/io/http_shutdown_test.dart
@@ -34,7 +34,7 @@ void test1(int totalConnections) {
}
-void test2(int totalConnections) {
+void test2(int totalConnections, int outputStreamWrites) {
// Server which responds without waiting for request body.
HttpServer server = new HttpServer();
server.listen("127.0.0.1", 0, backlog: totalConnections);
@@ -49,7 +49,8 @@ void test2(int totalConnections) {
HttpClientConnection conn = client.get("127.0.0.1", server.port, "/");
conn.onRequest = (HttpClientRequest request) {
request.contentLength = -1;
- request.outputStream.writeString("Hello, world!");
+ for (int i = 0; i < outputStreamWrites; i++)
+ request.outputStream.writeString("Hello, world!");
request.outputStream.close();
};
conn.onResponse = (HttpClientResponse response) {
@@ -62,6 +63,13 @@ void test2(int totalConnections) {
}
};
};
+ conn.onError = (e) {
+ count++;
+ if (count == totalConnections) {
+ client.shutdown();
+ server.close();
+ }
+ };
}
}
@@ -168,8 +176,9 @@ void test5(int totalConnections) {
void main() {
test1(1);
test1(10);
- test2(1);
- test2(10);
+ test2(1, 10);
+ test2(10, 10);
+ test2(10, 1000);
test3(1);
test3(10);
test4();
« no previous file with comments | « sdk/lib/io/socket_stream_impl.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698