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

Unified Diff: pkg/http/test/response_test.dart

Issue 11975017: Stop treating StreamController as a Stream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « pkg/http/test/multipart_test.dart ('k') | utils/pub/error_group.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/response_test.dart
diff --git a/pkg/http/test/response_test.dart b/pkg/http/test/response_test.dart
index bcfa5dcaa20573f50aff61cb437c1585beb503df..252df4aeb5a6cf563d09066d238b870092592ca4 100644
--- a/pkg/http/test/response_test.dart
+++ b/pkg/http/test/response_test.dart
@@ -44,26 +44,27 @@ void main() {
group('.fromStream()', () {
test('sets body', () {
- var stream = new StreamController();
- var streamResponse = new http.StreamedResponse(stream, 200, 13);
+ var controller = new StreamController();
+ var streamResponse = new http.StreamedResponse(
+ controller.stream, 200, 13);
var future = http.Response.fromStream(streamResponse)
.then((response) => response.body);
expect(future, completion(equals("Hello, world!")));
- stream.add([72, 101, 108, 108, 111, 44, 32]);
- stream.add([119, 111, 114, 108, 100, 33]);
- stream.close();
+ controller.add([72, 101, 108, 108, 111, 44, 32]);
+ controller.add([119, 111, 114, 108, 100, 33]);
+ controller.close();
});
test('sets bodyBytes', () {
- var stream = new StreamController();
- var streamResponse = new http.StreamedResponse(stream, 200, 5);
+ var controller = new StreamController();
+ var streamResponse = new http.StreamedResponse(controller.stream, 200, 5);
var future = http.Response.fromStream(streamResponse)
.then((response) => response.bodyBytes);
expect(future, completion(equals([104, 101, 108, 108, 111])));
- stream.add([104, 101, 108, 108, 111]);
- stream.close();
+ controller.add([104, 101, 108, 108, 111]);
+ controller.close();
});
});
}
« no previous file with comments | « pkg/http/test/multipart_test.dart ('k') | utils/pub/error_group.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698