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 library test.backend.live_test; | 5 library test.backend.live_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'state.dart'; | 9 import 'state.dart'; |
10 import 'suite.dart'; | 10 import 'suite.dart'; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 /// This returns the same [Future] as [onComplete]. It may not be called more | 104 /// This returns the same [Future] as [onComplete]. It may not be called more |
105 /// than once. | 105 /// than once. |
106 Future run(); | 106 Future run(); |
107 | 107 |
108 /// Signals that this test should stop emitting events and release any | 108 /// Signals that this test should stop emitting events and release any |
109 /// resources it may have allocated. | 109 /// resources it may have allocated. |
110 /// | 110 /// |
111 /// Once [close] is called, [onComplete] will complete if it hasn't already | 111 /// Once [close] is called, [onComplete] will complete if it hasn't already |
112 /// and [onStateChange] and [onError] will close immediately. This means that, | 112 /// and [onStateChange] and [onError] will close immediately. This means that, |
113 /// if the test was running at the time [close] is called, it will never emit | 113 /// if the test was running at the time [close] is called, it will never emit |
114 /// a [Status.complete] state-change event. | 114 /// a [Status.complete] state-change event. Once a test is closed, [expect] |
| 115 /// and [expectAsync] will throw a [ClosedException] to help the test |
| 116 /// terminate as quickly as possible. |
115 /// | 117 /// |
116 /// This doesn't automatically happen after the test completes because there | 118 /// This doesn't automatically happen after the test completes because there |
117 /// may be more asynchronous work going on in the background that could | 119 /// may be more asynchronous work going on in the background that could |
118 /// produce new errors. | 120 /// produce new errors. |
| 121 /// |
| 122 /// Returns a [Future] that completes once all resources are released *and* |
| 123 /// the test has completed. This allows the caller to wait until the test's |
| 124 /// tear-down logic has run. |
119 Future close(); | 125 Future close(); |
120 } | 126 } |
OLD | NEW |