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

Unified Diff: pkg/shelf/test/create_middleware_test.dart

Issue 260933004: Support Request hijacking in Shelf, using a similar API to Rack. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 7 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/shelf/pubspec.yaml ('k') | pkg/shelf/test/hijack_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/test/create_middleware_test.dart
diff --git a/pkg/shelf/test/create_middleware_test.dart b/pkg/shelf/test/create_middleware_test.dart
index 5c35f4d4b10fc0a8d2fe90edd05b8741844efcbb..ee01d07d99ca10a34141f636c82e1dd0c57bd4da 100644
--- a/pkg/shelf/test/create_middleware_test.dart
+++ b/pkg/shelf/test/create_middleware_test.dart
@@ -202,6 +202,18 @@ void main() {
expect(makeSimpleRequest(handler), throwsA('bad handler'));
});
+
+ test("doesn't handle HijackException", () {
+ var middleware = createMiddleware(errorHandler: (error, stack) {
+ expect(false, "error handler shouldn't be called");
+ });
+
+ var handler = const Pipeline().addMiddleware(middleware)
+ .addHandler((request) => throw const HijackException());
+
+ expect(makeSimpleRequest(handler),
+ throwsA(new isInstanceOf<HijackException>()));
+ });
});
}
« no previous file with comments | « pkg/shelf/pubspec.yaml ('k') | pkg/shelf/test/hijack_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698