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

Side by Side Diff: lib/src/invoker.dart

Issue 933083002: Add a test runner executable. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Code review changes Created 5 years, 10 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
« no previous file with comments | « lib/src/exit_codes.dart ('k') | lib/src/load_exception.dart » ('j') | 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) 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 unittest.invoker; 5 library unittest.invoker;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:stack_trace/stack_trace.dart'; 9 import 'package:stack_trace/stack_trace.dart';
10 10
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // If a [Future] returned from an error zone would throw an error 165 // If a [Future] returned from an error zone would throw an error
166 // through the zone boundary, it instead never completes, and we want to 166 // through the zone boundary, it instead never completes, and we want to
167 // avoid that. 167 // avoid that.
168 _completer.future.then((_) { 168 _completer.future.then((_) {
169 if (_test._tearDown == null) return null; 169 if (_test._tearDown == null) return null;
170 return new Future.sync(_test._tearDown); 170 return new Future.sync(_test._tearDown);
171 }).catchError(Zone.current.handleUncaughtError).then((_) { 171 }).catchError(Zone.current.handleUncaughtError).then((_) {
172 timer.cancel(); 172 timer.cancel();
173 _controller.setState( 173 _controller.setState(
174 new State(Status.complete, liveTest.state.result)); 174 new State(Status.complete, liveTest.state.result));
175 _controller.completer.complete(); 175
176 // Use [Timer.run] here to avoid starving the DOM or other
177 // non-microtask events.
178 Timer.run(_controller.completer.complete);
176 }); 179 });
177 }, zoneValues: {#unittest.invoker: this}, onError: handleError); 180 }, zoneValues: {#unittest.invoker: this}, onError: handleError);
178 }); 181 });
179 } 182 }
180 } 183 }
OLDNEW
« no previous file with comments | « lib/src/exit_codes.dart ('k') | lib/src/load_exception.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698