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

Unified Diff: pkg/http/test/utils.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: 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
« pkg/http/test/request_test.dart ('K') | « pkg/http/test/response_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/utils.dart
diff --git a/pkg/http/test/utils.dart b/pkg/http/test/utils.dart
index 9e9ae8b3408d37c5ab724bd4f8486fe0f41f3f18..a4238cfacb676e8eca6f3190f79979c9b363cb6d 100644
--- a/pkg/http/test/utils.dart
+++ b/pkg/http/test/utils.dart
@@ -4,6 +4,7 @@
library test_utils;
+import 'dart:async';
import 'dart:io';
import 'dart:json' as json;
import 'dart:uri';
@@ -104,6 +105,10 @@ void stopServer() {
_server = null;
}
+/// Buffers all input from an InputStream and returns it as a future.
Bob Nystrom 2013/01/08 23:50:49 Is this a dart:io compatibility thing? If so, docu
nweiz 2013/01/09 00:52:11 Done.
+Future<List<int>> consumeInputStream(InputStream stream) =>
+ new http.ByteStream(wrapInputStream(stream)).toBytes();
+
/// A matcher that matches JSON that parses to a value that matches the inner
/// matcher.
Matcher parse(matcher) => new _Parse(matcher);
« pkg/http/test/request_test.dart ('K') | « pkg/http/test/response_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698