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

Side by Side Diff: test/pipeline_test.dart

Issue 837193005: pkg/shelf: formatted code (Closed) Base URL: https://github.com/dart-lang/shelf.git@master
Patch Set: nits Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « test/message_test.dart ('k') | test/request_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library shelf.pipeline_test; 5 library shelf.pipeline_test;
6 6
7 import 'package:shelf/shelf.dart'; 7 import 'package:shelf/shelf.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 import 'test_util.dart'; 10 import 'test_util.dart';
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 var middlewareB = createMiddleware(requestHandler: (request) { 64 var middlewareB = createMiddleware(requestHandler: (request) {
65 expect(accessLocation, 1); 65 expect(accessLocation, 1);
66 accessLocation = 2; 66 accessLocation = 2;
67 return null; 67 return null;
68 }, responseHandler: (response) { 68 }, responseHandler: (response) {
69 expect(accessLocation, 3); 69 expect(accessLocation, 3);
70 accessLocation = 4; 70 accessLocation = 4;
71 return response; 71 return response;
72 }); 72 });
73 73
74 var innerPipeline = const Pipeline() 74 var innerPipeline =
75 .addMiddleware(middlewareA) 75 const Pipeline().addMiddleware(middlewareA).addMiddleware(middlewareB);
76 .addMiddleware(middlewareB);
77 76
78 var handler = const Pipeline() 77 var handler = const Pipeline()
79 .addMiddleware(innerPipeline.middleware) 78 .addMiddleware(innerPipeline.middleware)
80 .addHandler((request) { 79 .addHandler((request) {
81 expect(accessLocation, 2); 80 expect(accessLocation, 2);
82 accessLocation = 3; 81 accessLocation = 3;
83 return syncHandler(request); 82 return syncHandler(request);
84 }); 83 });
85 84
86 return makeSimpleRequest(handler).then((response) { 85 return makeSimpleRequest(handler).then((response) {
87 expect(response, isNotNull); 86 expect(response, isNotNull);
88 expect(accessLocation, 5); 87 expect(accessLocation, 5);
89 }); 88 });
90 }); 89 });
91 } 90 }
OLDNEW
« no previous file with comments | « test/message_test.dart ('k') | test/request_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698