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

Unified Diff: pkg/unittest/test/utils.dart

Issue 416133002: Abort unit tests in the event of async failure while awaiting a future. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
Index: pkg/unittest/test/utils.dart
diff --git a/pkg/unittest/test/utils.dart b/pkg/unittest/test/utils.dart
index 17a8cb62364bf90c449a66456dc538c2dc065361..1c7987df15da4948d0a14e7b41fbe1007c3e1485 100644
--- a/pkg/unittest/test/utils.dart
+++ b/pkg/unittest/test/utils.dart
@@ -5,7 +5,7 @@
part of unittestTest;
Future _defer(void fn()) {
- return new Future.sync(fn);
+ return (new Future.value()).then((_) => fn());
kevmoo 2014/07/29 19:59:02 Why not return new Future(() => fn()); ? Could
Paul Berry 2014/07/29 21:54:38 In fact, this works too and is even shorter: re
}
String buildStatusString(int passed, int failed, int errors,

Powered by Google App Engine
This is Rietveld 408576698