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

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

Issue 1196483002: Fix a VM test loading bug. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 6 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 | « CHANGELOG.md ('k') | pubspec.yaml » ('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.runner.loader; 5 library test.runner.loader;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 10
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 /// Load the test suite at [path] in VM isolate. 176 /// Load the test suite at [path] in VM isolate.
177 /// 177 ///
178 /// [metadata] is the suite-level metadata for the test. 178 /// [metadata] is the suite-level metadata for the test.
179 Future<Suite> _loadVmFile(String path, Metadata metadata) async { 179 Future<Suite> _loadVmFile(String path, Metadata metadata) async {
180 var receivePort = new ReceivePort(); 180 var receivePort = new ReceivePort();
181 181
182 var isolate; 182 var isolate;
183 try { 183 try {
184 if (_pubServeUrl != null) { 184 if (_pubServeUrl != null) {
185 var url = _pubServeUrl.resolve( 185 var url = _pubServeUrl.resolveUri(
186 p.relative(path, from: 'test') + '.vm_test.dart'); 186 p.toUri(p.relative(path, from: 'test') + '.vm_test.dart'));
187 187
188 // TODO(nweiz): Remove new Future.sync() once issue 23498 has been fixed 188 // TODO(nweiz): Remove new Future.sync() once issue 23498 has been fixed
189 // in two stable versions. 189 // in two stable versions.
190 await new Future.sync(() async { 190 await new Future.sync(() async {
191 try { 191 try {
192 isolate = await dart.spawnUri(url, { 192 isolate = await dart.spawnUri(url, {
193 'reply': receivePort.sendPort, 193 'reply': receivePort.sendPort,
194 'metadata': metadata.serialize() 194 'metadata': metadata.serialize()
195 }, checked: true); 195 }, checked: true);
196 } on IsolateSpawnException catch (error) { 196 } on IsolateSpawnException catch (error) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 for (var isolate in _isolates) { 255 for (var isolate in _isolates) {
256 isolate.kill(); 256 isolate.kill();
257 } 257 }
258 _isolates.clear(); 258 _isolates.clear();
259 259
260 if (!_browserServerThunk.hasRun) return; 260 if (!_browserServerThunk.hasRun) return;
261 await (await _browserServer).close(); 261 await (await _browserServer).close();
262 }); 262 });
263 } 263 }
264 } 264 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698