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

Unified Diff: test/hijack_test.dart

Issue 1640323004: Start switching hijacking to use StreamChannel. (Closed) Base URL: git@github.com:dart-lang/shelf@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/hijack_test.dart
diff --git a/test/hijack_test.dart b/test/hijack_test.dart
index 82b33eb908a9842ad0d1b2c93fb0288cff75d4c3..6b6c233ae6f5cef1b6da7de3a9c42d732161965a 100644
--- a/test/hijack_test.dart
+++ b/test/hijack_test.dart
@@ -11,7 +11,7 @@ import 'test_util.dart';
void main() {
test('hijacking a non-hijackable request throws a StateError', () {
- expect(() => new Request('GET', LOCALHOST_URI).hijack((_, __) => null),
+ expect(() => new Request('GET', LOCALHOST_URI).hijack((_) => null),
throwsStateError);
});
@@ -29,10 +29,10 @@ void main() {
callback(streamController.stream, sinkController);
}));
- expect(() => request.hijack(expectAsync((stream, sink) {
- expect(stream.first, completion(equals([1, 2, 3])));
- sink.add([4, 5, 6]);
- sink.close();
+ expect(() => request.hijack(expectAsync((channel) {
+ expect(channel.stream.first, completion(equals([1, 2, 3])));
+ channel.sink.add([4, 5, 6]);
+ channel.sink.close();
})), throwsA(new isInstanceOf<HijackException>()));
});
@@ -41,17 +41,17 @@ void main() {
var request = new Request('GET', LOCALHOST_URI,
onHijack: expectAsync((_) => null, count: 1));
- expect(() => request.hijack((_, __) => null),
+ expect(() => request.hijack((_) => null),
throwsA(new isInstanceOf<HijackException>()));
- expect(() => request.hijack((_, __) => null), throwsStateError);
+ expect(() => request.hijack((_) => null), throwsStateError);
});
group('calling change', () {
test('hijacking a non-hijackable request throws a StateError', () {
var request = new Request('GET', LOCALHOST_URI);
var newRequest = request.change();
- expect(() => newRequest.hijack((_, __) => null), throwsStateError);
+ expect(() => newRequest.hijack((_) => null), throwsStateError);
});
test('hijacking a hijackable request throws a HijackException and calls '
@@ -70,10 +70,10 @@ void main() {
var newRequest = request.change();
- expect(() => newRequest.hijack(expectAsync((stream, sink) {
- expect(stream.first, completion(equals([1, 2, 3])));
- sink.add([4, 5, 6]);
- sink.close();
+ expect(() => newRequest.hijack(expectAsync((channel) {
+ expect(channel.stream.first, completion(equals([1, 2, 3])));
+ channel.sink.add([4, 5, 6]);
+ channel.sink.close();
})), throwsA(new isInstanceOf<HijackException>()));
});
@@ -85,10 +85,10 @@ void main() {
var newRequest = request.change();
- expect(() => newRequest.hijack((_, __) => null),
+ expect(() => newRequest.hijack((_) => null),
throwsA(new isInstanceOf<HijackException>()));
- expect(() => request.hijack((_, __) => null), throwsStateError);
+ expect(() => request.hijack((_) => null), throwsStateError);
});
});
}
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698