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

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

Issue 12218102: Add built-in timeouts to scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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/scheduled_test/lib/src/schedule_error.dart
diff --git a/pkg/scheduled_test/lib/src/schedule_error.dart b/pkg/scheduled_test/lib/src/schedule_error.dart
index ce1f344946493dfeea69afede3dc462126b6f815..544a111db8ad88b72e0bb29a780d579d81befa71 100644
--- a/pkg/scheduled_test/lib/src/schedule_error.dart
+++ b/pkg/scheduled_test/lib/src/schedule_error.dart
@@ -19,9 +19,8 @@ class ScheduleError extends AsyncError {
/// there was no such task.
final Task task;
- /// Whether the schedule was finished executing at the time the error was
- /// detected.
- final bool _scheduleWasDone;
+ /// The state of the schedule at the time the error was detected.
+ final ScheduleState _stateWhenDetected;
/// Creates a new [ScheduleError] wrapping [error]. The metadata in
/// [AsyncError]s and [ScheduleError]s will be preserved.
@@ -47,7 +46,7 @@ class ScheduleError extends AsyncError {
this.task)
: super.withCause(error, stackTrace, cause),
this.schedule = schedule,
- this._scheduleWasDone = schedule.done;
+ this._stateWhenDetected = schedule.state;
String toString() {
var result = new StringBuffer();
@@ -68,9 +67,9 @@ class ScheduleError extends AsyncError {
if (task != null) {
result.add('Error detected during task in queue "${task.queue}":\n');
result.add(task.generateTree());
- } else if (_scheduleWasDone) {
+ } else if (_stateWhenDetected == ScheduleState.DONE) {
result.add('Error detected after all tasks in the queue had finished.');
- } else {
+ } else { // _stateWhenDetected == ScheduleState.SET_UP
Bob Nystrom 2013/02/12 00:34:17 How about doing an explicit else if here for this
nweiz 2013/02/12 01:15:57 I'm really paranoid about getting into an unexpect
result.add('Error detected before the schedule started running.');
}

Powered by Google App Engine
This is Rietveld 408576698