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

Unified Diff: pkg/unittest/lib/src/test_case.dart

Issue 19841002: Remove calls to [new Future] work around issue 11911. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change. Created 7 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
« no previous file with comments | « pkg/barback/test/utils.dart ('k') | sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/test_case.dart
diff --git a/pkg/unittest/lib/src/test_case.dart b/pkg/unittest/lib/src/test_case.dart
index e28d21f91cbe77232ec33a8724bae1bef91adfc9..75e126c9a2b1f0ef73ebc6943e7c7170c68c5193 100644
--- a/pkg/unittest/lib/src/test_case.dart
+++ b/pkg/unittest/lib/src/test_case.dart
@@ -90,8 +90,10 @@ class TestCase {
_result = _stackTrace = null;
_message = '';
- var f = (setUp == null) ? new Future.value() : new Future(setUp);
- return f.catchError(_errorHandler('Setup'))
+ // Avoid calling [new Future] to avoid issue 11911.
+ return new Future.value().then((_) {
+ if (setUp != null) return setUp();
+ }).catchError(_errorHandler('Setup'))
.then((_) {
// Skip the test if setup failed.
if (result != null) return new Future.value();
« no previous file with comments | « pkg/barback/test/utils.dart ('k') | sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698