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

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

Issue 1053443002: Rename the package to "test". (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 years, 8 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/backend/group.dart ('k') | lib/src/backend/live_test.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.backend.invoker; 5 library test.backend.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
11 import '../frontend/expect.dart'; 11 import '../frontend/expect.dart';
12 import '../utils.dart'; 12 import '../utils.dart';
13 import 'live_test.dart'; 13 import 'live_test.dart';
14 import 'live_test_controller.dart'; 14 import 'live_test_controller.dart';
15 import 'metadata.dart'; 15 import 'metadata.dart';
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 /// 65 ///
66 /// This is distinct from [_controller.completer] because a tear-down may need 66 /// This is distinct from [_controller.completer] because a tear-down may need
67 /// to run before the test is truly finished. 67 /// to run before the test is truly finished.
68 final _completer = new Completer(); 68 final _completer = new Completer();
69 69
70 /// The current invoker, or `null` if none is defined. 70 /// The current invoker, or `null` if none is defined.
71 /// 71 ///
72 /// An invoker is only set within the zone scope of a running test. 72 /// An invoker is only set within the zone scope of a running test.
73 static Invoker get current { 73 static Invoker get current {
74 // TODO(nweiz): Use a private symbol when dart2js supports it (issue 17526). 74 // TODO(nweiz): Use a private symbol when dart2js supports it (issue 17526).
75 return Zone.current[#unittest.invoker]; 75 return Zone.current[#test.invoker];
76 } 76 }
77 77
78 Invoker._(Suite suite, LocalTest test) { 78 Invoker._(Suite suite, LocalTest test) {
79 _controller = new LiveTestController(suite, test, _onRun); 79 _controller = new LiveTestController(suite, test, _onRun);
80 } 80 }
81 81
82 /// Tells the invoker that there's a callback running that it should wait for 82 /// Tells the invoker that there's a callback running that it should wait for
83 /// before considering the test successful. 83 /// before considering the test successful.
84 /// 84 ///
85 /// Each call to [addOutstandingCallback] should be followed by a call to 85 /// Each call to [addOutstandingCallback] should be followed by a call to
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 _controller.setState( 174 _controller.setState(
175 new State(Status.complete, liveTest.state.result)); 175 new State(Status.complete, liveTest.state.result));
176 176
177 // Use [Timer.run] here to avoid starving the DOM or other 177 // Use [Timer.run] here to avoid starving the DOM or other
178 // non-microtask events. 178 // non-microtask events.
179 Timer.run(_controller.completer.complete); 179 Timer.run(_controller.completer.complete);
180 }); 180 });
181 }, 181 },
182 zoneSpecification: new ZoneSpecification( 182 zoneSpecification: new ZoneSpecification(
183 print: (self, parent, zone, line) => _controller.print(line)), 183 print: (self, parent, zone, line) => _controller.print(line)),
184 zoneValues: {#unittest.invoker: this}, 184 zoneValues: {#test.invoker: this},
185 onError: handleError); 185 onError: handleError);
186 }); 186 });
187 } 187 }
188 } 188 }
OLDNEW
« no previous file with comments | « lib/src/backend/group.dart ('k') | lib/src/backend/live_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698