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

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: added test 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 | pkg/scheduled_test/test/metatest.dart » ('j') | pkg/scheduled_test/test/metatest.dart » ('J')
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..e532095bff36c5f8754297541158998b3cac02fd 100644
--- a/pkg/scheduled_test/lib/scheduled_test.dart
+++ b/pkg/scheduled_test/lib/scheduled_test.dart
@@ -233,8 +233,11 @@ void _test(String description, void body(), Function testFn) {
testFn(description, () {
var completer = new Completer();
+ var errorHandler;
nweiz 2014/04/08 19:27:36 Add a comment: "Capture this in a local variable i
kevmoo 2014/04/08 20:17:51 Done.
+
Chain.capture(() {
_currentSchedule = new Schedule();
+ errorHandler = _currentSchedule.signalError;
return currentSchedule.run(() {
if (_setUpFn != null) _setUpFn();
body();
@@ -247,7 +250,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: errorHandler);
nweiz 2014/04/09 01:20:41 I figured out the issue: this is being passed in w
return completer.future;
});
« no previous file with comments | « no previous file | pkg/scheduled_test/test/metatest.dart » ('j') | pkg/scheduled_test/test/metatest.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698