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

Side by Side Diff: lib/src/runner/runner_suite.dart

Issue 1394683002: pkg/test: put super call last (Closed) Base URL: https://github.com/dart-lang/test.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | 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) 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.runner.runner_suite; 5 library test.runner.runner_suite;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:async/async.dart'; 9 import 'package:async/async.dart';
10 10
(...skipping 15 matching lines...) Expand all
26 final Environment environment; 26 final Environment environment;
27 27
28 /// The memoizer for running [close] exactly once. 28 /// The memoizer for running [close] exactly once.
29 final _closeMemo = new AsyncMemoizer(); 29 final _closeMemo = new AsyncMemoizer();
30 30
31 /// The function to call when the suite is closed. 31 /// The function to call when the suite is closed.
32 final AsyncFunction _onClose; 32 final AsyncFunction _onClose;
33 33
34 RunnerSuite(this.environment, Group group, {String path, 34 RunnerSuite(this.environment, Group group, {String path,
35 TestPlatform platform, OperatingSystem os, AsyncFunction onClose}) 35 TestPlatform platform, OperatingSystem os, AsyncFunction onClose})
36 : super(group, path: path, platform: platform, os: os), 36 : _onClose = onClose,
37 _onClose = onClose; 37 super(group, path: path, platform: platform, os: os);
38 38
39 RunnerSuite filter(bool callback(Test test)) { 39 RunnerSuite filter(bool callback(Test test)) {
40 var filtered = group.filter(callback); 40 var filtered = group.filter(callback);
41 filtered ??= new Group.root([], metadata: metadata); 41 filtered ??= new Group.root([], metadata: metadata);
42 return new RunnerSuite(environment, filtered, 42 return new RunnerSuite(environment, filtered,
43 platform: platform, os: os, path: path); 43 platform: platform, os: os, path: path);
44 } 44 }
45 45
46 /// Closes the suite and releases any resources associated with it. 46 /// Closes the suite and releases any resources associated with it.
47 Future close() { 47 Future close() {
48 return _closeMemo.runOnce(() async { 48 return _closeMemo.runOnce(() async {
49 if (_onClose != null) await _onClose(); 49 if (_onClose != null) await _onClose();
50 }); 50 });
51 } 51 }
52 } 52 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698