OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library schedule; | 5 library schedule; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:stack_trace/stack_trace.dart'; | 10 import 'package:stack_trace/stack_trace.dart'; |
11 import 'package:unittest/unittest.dart' as unittest; | |
12 | 11 |
13 import 'mock_clock.dart' as mock_clock; | 12 import 'mock_clock.dart' as mock_clock; |
14 import 'schedule_error.dart'; | 13 import 'schedule_error.dart'; |
15 import 'substitute_future.dart'; | 14 import 'substitute_future.dart'; |
16 import 'task.dart'; | 15 import 'task.dart'; |
17 import 'utils.dart'; | 16 import 'utils.dart'; |
18 import 'value_future.dart'; | |
19 | 17 |
20 /// The schedule of tasks to run for a single test. This has three separate task | 18 /// The schedule of tasks to run for a single test. This has three separate task |
21 /// queues: [tasks], [onComplete], and [onException]. It also provides | 19 /// queues: [tasks], [onComplete], and [onException]. It also provides |
22 /// visibility into the current state of the schedule. | 20 /// visibility into the current state of the schedule. |
23 class Schedule { | 21 class Schedule { |
24 /// The main task queue for the schedule. These tasks are run before the other | 22 /// The main task queue for the schedule. These tasks are run before the other |
25 /// queues and generally constitute the main test body. | 23 /// queues and generally constitute the main test body. |
26 TaskQueue get tasks => _tasks; | 24 TaskQueue get tasks => _tasks; |
27 TaskQueue _tasks; | 25 TaskQueue _tasks; |
28 | 26 |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 /// The string description of the callback. | 605 /// The string description of the callback. |
608 String get description { | 606 String get description { |
609 if (_description == null) _description = _thunk(); | 607 if (_description == null) _description = _thunk(); |
610 return _description; | 608 return _description; |
611 } | 609 } |
612 | 610 |
613 String toString() => description; | 611 String toString() => description; |
614 | 612 |
615 PendingCallback._(this._thunk); | 613 PendingCallback._(this._thunk); |
616 } | 614 } |
OLD | NEW |