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

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

Issue 1097183003: Add an "onPlatform" parameter to test() and group(). (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/declarer.dart ('k') | lib/src/backend/metadata.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 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
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}) {
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
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 }
OLDNEW
« no previous file with comments | « lib/src/backend/declarer.dart ('k') | lib/src/backend/metadata.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698