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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 import 'dart:isolate'; | 7 import 'dart:isolate'; |
8 | 8 |
9 import 'package:analyzer/analyzer.dart' hide Configuration; | 9 import 'package:analyzer/analyzer.dart' hide Configuration; |
10 import 'package:async/async.dart'; | 10 import 'package:async/async.dart'; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 new Group.root([], metadata: metadata), | 123 new Group.root([], metadata: metadata), |
124 path: path, platform: platform)); | 124 path: path, platform: platform)); |
125 continue; | 125 continue; |
126 } | 126 } |
127 | 127 |
128 var name = (platform.isJS ? "compiling " : "loading ") + path; | 128 var name = (platform.isJS ? "compiling " : "loading ") + path; |
129 yield new LoadSuite(name, () { | 129 yield new LoadSuite(name, () { |
130 return platform == TestPlatform.vm | 130 return platform == TestPlatform.vm |
131 ? _loadVmFile(path, metadata) | 131 ? _loadVmFile(path, metadata) |
132 : _loadBrowserFile(path, platform, metadata); | 132 : _loadBrowserFile(path, platform, metadata); |
133 }, platform: platform); | 133 }, path: path, platform: platform); |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 /// Load the test suite at [path] in [platform]. | 137 /// Load the test suite at [path] in [platform]. |
138 /// | 138 /// |
139 /// [metadata] is the suite-level metadata for the test. | 139 /// [metadata] is the suite-level metadata for the test. |
140 Future<RunnerSuite> _loadBrowserFile(String path, TestPlatform platform, | 140 Future<RunnerSuite> _loadBrowserFile(String path, TestPlatform platform, |
141 Metadata metadata) async => | 141 Metadata metadata) async => |
142 (await _browserServer).loadSuite(path, platform, metadata); | 142 (await _browserServer).loadSuite(path, platform, metadata); |
143 | 143 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 Future close() { | 264 Future close() { |
265 return _closeMemo.runOnce(() async { | 265 return _closeMemo.runOnce(() async { |
266 await Future.wait(_suites.map((suite) => suite.close())); | 266 await Future.wait(_suites.map((suite) => suite.close())); |
267 _suites.clear(); | 267 _suites.clear(); |
268 | 268 |
269 if (!_browserServerMemo.hasRun) return; | 269 if (!_browserServerMemo.hasRun) return; |
270 await (await _browserServer).close(); | 270 await (await _browserServer).close(); |
271 }); | 271 }); |
272 } | 272 } |
273 } | 273 } |
OLD | NEW |