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

Unified Diff: test/server_test.dart

Issue 12578002: Add Router.defaultStream Base URL: https://github.com/dart-lang/route.git@master
Patch Set: Created 7 years, 9 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
« lib/server.dart ('K') | « lib/server.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/server_test.dart
diff --git a/test/server_test.dart b/test/server_test.dart
index bac8d135c86aec54da011f272582bc84d05b771d..d6f0e1cd83d2619745d7bc0a4360382e77877818 100644
--- a/test/server_test.dart
+++ b/test/server_test.dart
@@ -61,6 +61,19 @@ main() {
controller.add(testReq);
});
+ test('default', () {
+ var controller = new StreamController<HttpRequest>();
+ var router = new Router(controller.stream);
+ var testReq = new HttpRequestMock(new Uri('/bar'));
+ testReq.response._onClose = expectAsync0(() {
+ expect(testReq.response.statusCode, 200);
+ });
+ router.defaultStream.listen(expectAsync1((HttpRequest req) {
+ req.response.statusCode = 200;
+ req.response.close();
+ }));
+ controller.add(testReq);
+ });
test('filter pass', () {
var controller = new StreamController<HttpRequest>();
« lib/server.dart ('K') | « lib/server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698