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

Unified Diff: pkg/http_server/test/http_body_test.dart

Issue 46043003: The request may be canceled by http_body, thus allow that when testing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « pkg/http_server/lib/src/http_body_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http_server/test/http_body_test.dart
diff --git a/pkg/http_server/test/http_body_test.dart b/pkg/http_server/test/http_body_test.dart
index bae4e1bf980340b5b9cfefb03a48c93a4a7782e6..e8d84c089332e5aeb09a07160f4bcf55d3b16f6e 100644
--- a/pkg/http_server/test/http_body_test.dart
+++ b/pkg/http_server/test/http_body_test.dart
@@ -90,6 +90,7 @@ void testHttpServerRequestBody() {
HttpServer.bind("127.0.0.1", 0).then((server) {
server.transform(new HttpBodyHandler(defaultEncoding: defaultEncoding))
.listen((body) {
+ if (shouldFail) return;
expect(shouldFail, isFalse);
expect(body.type, equals(type));
switch (type) {
@@ -157,9 +158,12 @@ void testHttpServerRequestBody() {
}
return response.drain();
})
- .then((_) {
+ .whenComplete(() {
client.close();
server.close();
+ })
+ .catchError((e) {
+ if (!shouldFail) throw e;
});
});
}
« no previous file with comments | « pkg/http_server/lib/src/http_body_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698