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.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 |
(...skipping 24 matching lines...) Expand all Loading... | |
35 | 35 |
36 LocalTest(this.name, this.metadata, body(), {tearDown()}) | 36 LocalTest(this.name, this.metadata, body(), {tearDown()}) |
37 : _body = body, | 37 : _body = body, |
38 _tearDown = tearDown; | 38 _tearDown = tearDown; |
39 | 39 |
40 /// Loads a single runnable instance of this test. | 40 /// Loads a single runnable instance of this test. |
41 LiveTest load(Suite suite) { | 41 LiveTest load(Suite suite) { |
42 var invoker = new Invoker._(suite, this); | 42 var invoker = new Invoker._(suite, this); |
43 return invoker.liveTest; | 43 return invoker.liveTest; |
44 } | 44 } |
45 | |
46 Test change({String name, Metadata metadata}) { | |
kevmoo
2015/04/20 22:42:30
docs?
nweiz
2015/04/20 22:57:53
Done (in Test).
| |
47 if (name == null) name = this.name; | |
48 if (metadata == null) metadata = this.metadata; | |
49 return new LocalTest(name, metadata, _body, tearDown: _tearDown); | |
50 } | |
45 } | 51 } |
46 | 52 |
47 /// The class responsible for managing the lifecycle of a single local test. | 53 /// The class responsible for managing the lifecycle of a single local test. |
48 /// | 54 /// |
49 /// The current invoker is accessible within the zone scope of the running test | 55 /// The current invoker is accessible within the zone scope of the running test |
50 /// using [Invoker.current]. It's used to track asynchronous callbacks and | 56 /// using [Invoker.current]. It's used to track asynchronous callbacks and |
51 /// report asynchronous errors. | 57 /// report asynchronous errors. |
52 class Invoker { | 58 class Invoker { |
53 /// The live test being driven by the invoker. | 59 /// The live test being driven by the invoker. |
54 /// | 60 /// |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 Timer.run(_controller.completer.complete); | 199 Timer.run(_controller.completer.complete); |
194 }); | 200 }); |
195 }, | 201 }, |
196 zoneSpecification: new ZoneSpecification( | 202 zoneSpecification: new ZoneSpecification( |
197 print: (self, parent, zone, line) => _controller.print(line)), | 203 print: (self, parent, zone, line) => _controller.print(line)), |
198 zoneValues: {#test.invoker: this}, | 204 zoneValues: {#test.invoker: this}, |
199 onError: handleError); | 205 onError: handleError); |
200 }); | 206 }); |
201 } | 207 } |
202 } | 208 } |
OLD | NEW |