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

Unified Diff: pkg/scheduled_test/lib/scheduled_test.dart

Issue 227193002: pkg/scheduled_test: handle null currentSchedule due to timeout (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/scheduled_test.dart
diff --git a/pkg/scheduled_test/lib/scheduled_test.dart b/pkg/scheduled_test/lib/scheduled_test.dart
index b6ba30d7e2d9513c6b8aabf8da510d93d0c750ed..ad34112f1558720cfdd4f4ef3dca442813112002 100644
--- a/pkg/scheduled_test/lib/scheduled_test.dart
+++ b/pkg/scheduled_test/lib/scheduled_test.dart
@@ -233,8 +233,10 @@ void _test(String description, void body(), Function testFn) {
testFn(description, () {
var completer = new Completer();
+ Schedule localSchedule;
nweiz 2014/04/07 18:02:21 Don't type-annotate local variables.
kevmoo 2014/04/08 01:29:33 Done.
+
Chain.capture(() {
- _currentSchedule = new Schedule();
+ localSchedule = _currentSchedule = new Schedule();
nweiz 2014/04/07 18:02:21 We generally avoid multiple assignments on the sam
kevmoo 2014/04/08 01:29:33 Done.
return currentSchedule.run(() {
if (_setUpFn != null) _setUpFn();
body();
@@ -247,7 +249,7 @@ void _test(String description, void body(), Function testFn) {
unittest.registerException(error, new Chain.forTrace(stackTrace));
}
}).then(completer.complete);
- }, onError: (error, chain) => currentSchedule.signalError(error, chain));
+ }, onError: (error, chain) => localSchedule.signalError(error, chain));
return completer.future;
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698