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

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

Issue 11825010: Update pkg/http to use the new async APIs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes 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/http_test.dart ('k') | pkg/http/test/multipart_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « pkg/http/test/http_test.dart ('k') | pkg/http/test/multipart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698