Index: pkg/http/test/mock_client_test.dart |
diff --git a/pkg/http/test/mock_client_test.dart b/pkg/http/test/mock_client_test.dart |
index 01581a8197cea2381ec4ad0f6272f72098c7b0a2..02e713b00b6bb1d2abd1c59394609ac79e6b1932 100644 |
--- a/pkg/http/test/mock_client_test.dart |
+++ b/pkg/http/test/mock_client_test.dart |
@@ -34,12 +34,11 @@ void main() { |
test('handles a streamed request', () { |
var client = new MockClient.streaming((request, bodyStream) { |
- return consumeInputStream(bodyStream).then((body) { |
- var stream = new ListInputStream(); |
+ return bodyStream.bytesToString().then((bodyString) { |
+ var stream = new StreamController<List<int>>.singleSubscription(); |
async.then((_) { |
- var bodyString = new String.fromCharCodes(body); |
- stream.write('Request body was "$bodyString"'.charCodes); |
- stream.markEndOfStream(); |
+ stream.add('Request body was "$bodyString"'.charCodes); |
+ stream.close(); |
}); |
return new http.StreamedResponse(stream, 200, -1); |