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

Side by Side Diff: test/hijack_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/create_middleware_test.dart ('k') | test/message_change_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.hijack_test; 5 library shelf.hijack_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import 'package:shelf/shelf.dart'; 10 import 'package:shelf/shelf.dart';
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 expect(() => request.hijack((_, __) => null), 46 expect(() => request.hijack((_, __) => null),
47 throwsA(new isInstanceOf<HijackException>())); 47 throwsA(new isInstanceOf<HijackException>()));
48 48
49 expect(() => request.hijack((_, __) => null), throwsStateError); 49 expect(() => request.hijack((_, __) => null), throwsStateError);
50 }); 50 });
51 51
52 group('calling change', () { 52 group('calling change', () {
53 test('hijacking a non-hijackable request throws a StateError', () { 53 test('hijacking a non-hijackable request throws a StateError', () {
54 var request = new Request('GET', LOCALHOST_URI); 54 var request = new Request('GET', LOCALHOST_URI);
55 var newRequest = request.change(); 55 var newRequest = request.change();
56 expect(() => newRequest.hijack((_, __) => null), 56 expect(() => newRequest.hijack((_, __) => null), throwsStateError);
57 throwsStateError);
58 }); 57 });
59 58
60 test('hijacking a hijackable request throws a HijackException and calls ' 59 test('hijacking a hijackable request throws a HijackException and calls '
61 'onHijack', () { 60 'onHijack', () {
62 var request = new Request('GET', LOCALHOST_URI, 61 var request = new Request('GET', LOCALHOST_URI,
63 onHijack: expectAsync((callback) { 62 onHijack: expectAsync((callback) {
64 var streamController = new StreamController(); 63 var streamController = new StreamController();
65 streamController.add([1, 2, 3]); 64 streamController.add([1, 2, 3]);
66 streamController.close(); 65 streamController.close();
67 66
(...skipping 20 matching lines...) Expand all
88 87
89 var newRequest = request.change(); 88 var newRequest = request.change();
90 89
91 expect(() => newRequest.hijack((_, __) => null), 90 expect(() => newRequest.hijack((_, __) => null),
92 throwsA(new isInstanceOf<HijackException>())); 91 throwsA(new isInstanceOf<HijackException>()));
93 92
94 expect(() => request.hijack((_, __) => null), throwsStateError); 93 expect(() => request.hijack((_, __) => null), throwsStateError);
95 }); 94 });
96 }); 95 });
97 } 96 }
OLDNEW
« no previous file with comments | « test/create_middleware_test.dart ('k') | test/message_change_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698