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

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: 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/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..53ff769bbf68a1a16a3a2ab3250cbbf85e75e074 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,11 @@ void stopServer() {
_server = null;
}
+// TODO(nweiz): remove this once issue 7785 is fixed.
+/// Buffers all input from an InputStream and returns it as a future.
+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);
« no previous file with comments | « pkg/http/test/response_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698