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

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

Issue 11364122: Do *not* report connection reset by peer as an error on an http server (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « sdk/lib/io/http_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_advanced_test.dart
diff --git a/tests/standalone/io/http_advanced_test.dart b/tests/standalone/io/http_advanced_test.dart
index a37d025c57fd426d05154fd2ef08319074d09d5c..bca0def8cdee57b16cab1652e6cb1594bba6e1f0 100644
--- a/tests/standalone/io/http_advanced_test.dart
+++ b/tests/standalone/io/http_advanced_test.dart
@@ -255,7 +255,8 @@ class TestServer {
bool _chunkedEncoding = false;
}
-void testHost() {
+Future testHost() {
+ Completer completer = new Completer();
TestServerMain testServerMain = new TestServerMain();
testServerMain.setServerStartedHandler((int port) {
HttpClient httpClient = new HttpClient();
@@ -288,12 +289,15 @@ void testHost() {
Expect.equals(HttpStatus.OK, response.statusCode);
httpClient.shutdown();
testServerMain.shutdown();
+ completer.complete(true);
};
});
testServerMain.start();
+ return completer.future;
}
-void testExpires() {
+Future testExpires() {
+ Completer completer = new Completer();
TestServerMain testServerMain = new TestServerMain();
testServerMain.setServerStartedHandler((int port) {
int responses = 0;
@@ -309,6 +313,7 @@ void testExpires() {
if (responses == 2) {
httpClient.shutdown();
testServerMain.shutdown();
+ completer.complete(true);
}
}
@@ -322,9 +327,11 @@ void testExpires() {
};
});
testServerMain.start();
+ return completer.future;
}
-void testContentType() {
+Future testContentType() {
+ Completer completer = new Completer();
TestServerMain testServerMain = new TestServerMain();
testServerMain.setServerStartedHandler((int port) {
int responses = 0;
@@ -343,6 +350,7 @@ void testContentType() {
if (responses == 2) {
httpClient.shutdown();
testServerMain.shutdown();
+ completer.complete(true);
}
}
@@ -370,9 +378,11 @@ void testContentType() {
};
});
testServerMain.start();
+ return completer.future;
}
-void testCookies() {
+Future testCookies() {
+ Completer completer = new Completer();
TestServerMain testServerMain = new TestServerMain();
testServerMain.setServerStartedHandler((int port) {
int responses = 0;
@@ -408,13 +418,16 @@ void testCookies() {
conn2.onResponse = (HttpClientResponse ignored) {
httpClient.shutdown();
testServerMain.shutdown();
+ completer.complete(true);
};
};
});
testServerMain.start();
+ return completer.future;
}
-void testFlush() {
+Future testFlush() {
+ Completer completer = new Completer();
TestServerMain testServerMain = new TestServerMain();
testServerMain.setServerStartedHandler((int port) {
HttpClient httpClient = new HttpClient();
@@ -428,15 +441,28 @@ void testFlush() {
Expect.equals(HttpStatus.OK, response.statusCode);
httpClient.shutdown();
testServerMain.shutdown();
+ completer.complete(true);
};
});
testServerMain.start();
+ return completer.future;
}
void main() {
- testHost();
- testExpires();
- testContentType();
- testCookies();
- testFlush();
+ print('testHost()');
+ testHost().chain((_) {
+ print('testExpires()');
+ return testExpires().chain((_) {
+ print('testContentType()');
+ return testContentType().chain((_) {
+ print('testCookies()');
+ return testCookies().chain((_) {
+ print('testFlush()');
+ return testFlush();
+ });
+ });
+ });
+ }).then((_) {
+ print('done');
+ });
}
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698