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

Side by Side Diff: lib/test.dart

Issue 1159923010: Use the Zone API for registerException. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: more changes Created 5 years, 6 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 unified diff | Download patch
« CHANGELOG.md ('K') | « lib/src/frontend/future_matchers.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« CHANGELOG.md ('K') | « lib/src/frontend/future_matchers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698