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.util.compiler_pool; | 5 library test.util.compiler_pool; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 import "${p.toUri(p.absolute(dartPath))}" as test; | 64 import "${p.toUri(p.absolute(dartPath))}" as test; |
65 | 65 |
66 void main(_) { | 66 void main(_) { |
67 IframeListener.start(() => test.main); | 67 IframeListener.start(() => test.main); |
68 } | 68 } |
69 '''); | 69 '''); |
70 | 70 |
71 var dart2jsPath = p.join(sdkDir, 'bin', 'dart2js'); | 71 var dart2jsPath = p.join(sdkDir, 'bin', 'dart2js'); |
72 if (Platform.isWindows) dart2jsPath += '.bat'; | 72 if (Platform.isWindows) dart2jsPath += '.bat'; |
73 | 73 |
74 var args = ["--checked", wrapperPath, "--out=$jsPath", "--show-package-w
arnings"]; | 74 var args = ["--checked", wrapperPath, "--out=$jsPath"]; |
75 | 75 |
76 if (packageRoot != null) { | 76 if (packageRoot != null) { |
77 args.add("--package-root=${p.toUri(p.absolute(packageRoot))}"); | 77 args.add("--package-root=${p.toUri(p.absolute(packageRoot))}"); |
78 } | 78 } |
79 | 79 |
80 if (_color) args.add("--enable-diagnostic-colors"); | 80 if (_color) args.add("--enable-diagnostic-colors"); |
81 | 81 |
82 var process = await Process.start(dart2jsPath, args); | 82 var process = await Process.start(dart2jsPath, args); |
83 if (_closed) { | 83 if (_closed) { |
84 process.kill(); | 84 process.kill(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 /// have been killed and all resources released. | 143 /// have been killed and all resources released. |
144 Future close() { | 144 Future close() { |
145 return _closeMemo.runOnce(() async { | 145 return _closeMemo.runOnce(() async { |
146 await Future.wait(_processes.map((process) async { | 146 await Future.wait(_processes.map((process) async { |
147 process.kill(); | 147 process.kill(); |
148 await process.exitCode; | 148 await process.exitCode; |
149 })); | 149 })); |
150 }); | 150 }); |
151 } | 151 } |
152 } | 152 } |
OLD | NEW |