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 test; | 5 library test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
10 | 10 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 /// | 166 /// |
167 /// This function will be called after each test is run. [callback] may be | 167 /// This function will be called after each test is run. [callback] may be |
168 /// asynchronous; if so, it must return a [Future]. | 168 /// asynchronous; if so, it must return a [Future]. |
169 /// | 169 /// |
170 /// If this is called within a test group, it applies only to tests in that | 170 /// If this is called within a test group, it applies only to tests in that |
171 /// group. [callback] will be run before any tear-down callbacks in parent | 171 /// group. [callback] will be run before any tear-down callbacks in parent |
172 /// groups or at the top level. | 172 /// groups or at the top level. |
173 void tearDown(callback()) => _declarer.tearDown(callback); | 173 void tearDown(callback()) => _declarer.tearDown(callback); |
174 | 174 |
175 /// Registers an exception that was caught for the current test. | 175 /// Registers an exception that was caught for the current test. |
176 void registerException(error, [StackTrace stackTrace]) => | 176 void registerException(error, [StackTrace stackTrace]) { |
177 Invoker.current.handleError(error, stackTrace); | 177 // This will usually forward directly to [Invoker.current.handleError], but |
| 178 // going through the zone API allows other zones to consistently see errors. |
| 179 Zone.current.handleUncaughtError(error, stackTrace); |
| 180 } |
OLD | NEW |