| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'group.dart'; | 7 import 'group.dart'; |
| 8 import 'message.dart'; |
| 8 import 'state.dart'; | 9 import 'state.dart'; |
| 9 import 'suite.dart'; | 10 import 'suite.dart'; |
| 10 import 'test.dart'; | 11 import 'test.dart'; |
| 11 | 12 |
| 12 /// A runnable instance of a test. | 13 /// A runnable instance of a test. |
| 13 /// | 14 /// |
| 14 /// This is distinct from [Test] in order to keep [Test] immutable. Running a | 15 /// This is distinct from [Test] in order to keep [Test] immutable. Running a |
| 15 /// test requires state, and [LiveTest] provides a view of the state of the test | 16 /// test requires state, and [LiveTest] provides a view of the state of the test |
| 16 /// as it runs. | 17 /// as it runs. |
| 17 /// | 18 /// |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 List<AsyncError> get errors; | 78 List<AsyncError> get errors; |
| 78 | 79 |
| 79 /// A stream that emits a new [AsyncError] whenever an error is caught. | 80 /// A stream that emits a new [AsyncError] whenever an error is caught. |
| 80 /// | 81 /// |
| 81 /// This will be emit an event after [errors] is updated. These errors are not | 82 /// This will be emit an event after [errors] is updated. These errors are not |
| 82 /// guaranteed to have the same types as when they were thrown; for example, | 83 /// guaranteed to have the same types as when they were thrown; for example, |
| 83 /// they may need to be serialized across isolate boundaries. The stack traces | 84 /// they may need to be serialized across isolate boundaries. The stack traces |
| 84 /// will be [Chain]s. | 85 /// will be [Chain]s. |
| 85 Stream<AsyncError> get onError; | 86 Stream<AsyncError> get onError; |
| 86 | 87 |
| 87 /// A stream that emits lines printed by the test. | 88 /// A stream that emits messages produced by the test. |
| 88 Stream<String> get onPrint; | 89 Stream<Message> get onMessage; |
| 89 | 90 |
| 90 /// A [Future] that completes once the test is complete. | 91 /// A [Future] that completes once the test is complete. |
| 91 /// | 92 /// |
| 92 /// This will complete after [onStateChange] has fired, and after [onError] | 93 /// This will complete after [onStateChange] has fired, and after [onError] |
| 93 /// has fired if the test completes because of an error. It's the same as the | 94 /// has fired if the test completes because of an error. It's the same as the |
| 94 /// [Future] returned by [run]. | 95 /// [Future] returned by [run]. |
| 95 /// | 96 /// |
| 96 /// Note that even once this completes, the test may still be running code | 97 /// Note that even once this completes, the test may still be running code |
| 97 /// asynchronously. A test is considered complete either once it hits its | 98 /// asynchronously. A test is considered complete either once it hits its |
| 98 /// first error or when all [expectAsync] callbacks have been called and any | 99 /// first error or when all [expectAsync] callbacks have been called and any |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 /// | 139 /// |
| 139 /// This doesn't automatically happen after the test completes because there | 140 /// This doesn't automatically happen after the test completes because there |
| 140 /// may be more asynchronous work going on in the background that could | 141 /// may be more asynchronous work going on in the background that could |
| 141 /// produce new errors. | 142 /// produce new errors. |
| 142 /// | 143 /// |
| 143 /// Returns a [Future] that completes once all resources are released *and* | 144 /// Returns a [Future] that completes once all resources are released *and* |
| 144 /// the test has completed. This allows the caller to wait until the test's | 145 /// the test has completed. This allows the caller to wait until the test's |
| 145 /// tear-down logic has run. | 146 /// tear-down logic has run. |
| 146 Future close(); | 147 Future close(); |
| 147 } | 148 } |
| OLD | NEW |