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

Unified Diff: pkg/unittest/test/unittest_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/unittest/lib/unittest.dart ('k') | runtime/bin/socket_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/unittest_test.dart
diff --git a/pkg/unittest/test/unittest_test.dart b/pkg/unittest/test/unittest_test.dart
index 8a641a4a03fe50424c33a4a89eae44bf71c68f2f..f6a2f5dab31df02b917a100f4321ff80205d3d7d 100644
--- a/pkg/unittest/test/unittest_test.dart
+++ b/pkg/unittest/test/unittest_test.dart
@@ -15,7 +15,7 @@ import 'dart:async';
import 'package:unittest/unittest.dart';
Future _defer(void fn()) {
- return new Future.of(fn);
+ return new Future.sync(fn);
}
String buildStatusString(int passed, int failed, int errors,
@@ -154,37 +154,37 @@ runTest() {
} else if (testName == 'async setup/teardown test') {
group('good setup/good teardown', () {
setUp(() {
- return new Future.immediate(0);
+ return new Future.value(0);
});
tearDown(() {
- return new Future.immediate(0);
+ return new Future.value(0);
});
test('foo1', (){});
});
group('good setup/bad teardown', () {
setUp(() {
- return new Future.immediate(0);
+ return new Future.value(0);
});
tearDown(() {
- return new Future.immediateError("Failed to complete tearDown");
+ return new Future.error("Failed to complete tearDown");
});
test('foo2', (){});
});
group('bad setup/good teardown', () {
setUp(() {
- return new Future.immediateError("Failed to complete setUp");
+ return new Future.error("Failed to complete setUp");
});
tearDown(() {
- return new Future.immediate(0);
+ return new Future.value(0);
});
test('foo3', (){});
});
group('bad setup/bad teardown', () {
setUp(() {
- return new Future.immediateError("Failed to complete setUp");
+ return new Future.error("Failed to complete setUp");
});
tearDown(() {
- return new Future.immediateError("Failed to complete tearDown");
+ return new Future.error("Failed to complete tearDown");
});
test('foo4', (){});
});
« no previous file with comments | « pkg/unittest/lib/unittest.dart ('k') | runtime/bin/socket_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698