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

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

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 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/utils.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 f1f75bfe62e91e72e4f09953fcfc21284b2fe415..a77d96534ec69a5939caa38bbf56065ffe38de58 100644
--- a/pkg/http/test/mock_client_test.dart
+++ b/pkg/http/test/mock_client_test.dart
@@ -19,7 +19,7 @@ import 'utils.dart';
void main() {
test('handles a request', () {
var client = new MockClient((request) {
- return new Future.immediate(new http.Response(
+ return new Future.value(new http.Response(
json.stringify(request.bodyFields), 200,
request: request, headers: {'content-type': 'application/json'}));
});
@@ -57,7 +57,7 @@ void main() {
test('handles a request with no body', () {
var client = new MockClient((request) {
- return new Future.immediate(new http.Response('you did it', 200));
+ return new Future.value(new http.Response('you did it', 200));
});
expect(client.read("http://example.com/foo"),
« no previous file with comments | « pkg/http/lib/src/utils.dart ('k') | pkg/http/test/multipart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698