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

Unified Diff: pkg/http/lib/src/mock_client.dart

Issue 11783009: Big merge from experimental to bleeding edge. (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/lib/src/io_client.dart ('k') | pkg/http/lib/src/multipart_file.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/mock_client.dart
diff --git a/pkg/http/lib/src/mock_client.dart b/pkg/http/lib/src/mock_client.dart
index 90c5d1926038e148e3cf8f09076d04024ddf1841..8af54743948bfcc2f47c918595818e2b137f4b50 100644
--- a/pkg/http/lib/src/mock_client.dart
+++ b/pkg/http/lib/src/mock_client.dart
@@ -4,6 +4,7 @@
library mock_client;
+import 'dart:async';
import 'dart:io';
import 'base_client.dart';
@@ -31,7 +32,7 @@ class MockClient extends BaseClient {
/// [Response]s.
MockClient(MockClientHandler fn)
: this._((baseRequest, bodyStream) {
- return consumeInputStream(bodyStream).chain((bodyBytes) {
+ return consumeInputStream(bodyStream).then((bodyBytes) {
var request = new Request(baseRequest.method, baseRequest.url);
request.persistentConnection = baseRequest.persistentConnection;
request.followRedirects = baseRequest.followRedirects;
@@ -41,7 +42,7 @@ class MockClient extends BaseClient {
request.finalize();
return fn(request);
- }).transform((response) {
+ }).then((response) {
var stream = new ListInputStream();
stream.write(response.bodyBytes);
stream.markEndOfStream();
@@ -62,7 +63,7 @@ class MockClient extends BaseClient {
/// sends [StreamedResponse]s.
MockClient.streaming(MockClientStreamHandler fn)
: this._((request, bodyStream) {
- return fn(request, bodyStream).transform((response) {
+ return fn(request, bodyStream).then((response) {
return new StreamedResponse(
response.stream,
response.statusCode,
@@ -78,7 +79,7 @@ class MockClient extends BaseClient {
/// Sends a request.
Future<StreamedResponse> send(BaseRequest request) {
var bodyStream = request.finalize();
- return async.chain((_) => _handler(request, bodyStream));
+ return async.then((_) => _handler(request, bodyStream));
}
}
« no previous file with comments | « pkg/http/lib/src/io_client.dart ('k') | pkg/http/lib/src/multipart_file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698