Chromium Code Reviews| Index: tests/compiler/dart2js/source_map_pub_build_validity_test.dart |
| diff --git a/tests/compiler/dart2js/source_map_pub_build_validity_test.dart b/tests/compiler/dart2js/source_map_pub_build_validity_test.dart |
| index 939f9a233d3afc4f776c88b98409e02c1cd0243a..69cf5e14ed360fe1b0e6322349f0c386cd9c1910 100644 |
| --- a/tests/compiler/dart2js/source_map_pub_build_validity_test.dart |
| +++ b/tests/compiler/dart2js/source_map_pub_build_validity_test.dart |
| @@ -10,25 +10,37 @@ import 'package:expect/expect.dart'; |
| import 'source_map_validator_helper.dart'; |
| void main() { |
| - asyncTest(() => createTempDir().then((Directory tmpDir) { |
| - Directory sunflowerDir = new Directory.fromUri( |
| - Platform.script.resolve('../../../third_party/sunflower')); |
| + asyncTest(() async { |
| + Directory tmpDir = createTempDir(); |
|
Bill Hesse
2015/08/18 09:41:25
This needs to be = await createTempDir();
|
| + try { |
| + Directory sunflowerDir = new Directory.fromUri( |
| + Platform.script.resolve('../../../third_party/sunflower')); |
| - print("Copying '${sunflowerDir.path}' to '${tmpDir.path}'."); |
| - copyDirectory(sunflowerDir, tmpDir); |
| - String ext = Platform.isWindows ? '.bat' : ''; |
| - String command = path.normalize(path.join(path.fromUri(Platform.script), |
| - '../../../../sdk/bin/pub${ext}')); |
| - String file = path.join(tmpDir.path, 'build/web/sunflower.dart.js'); |
| - print("Running '$command build --mode=debug' from '${tmpDir}'."); |
| - return Process.run(command, ['build','--mode=debug'], |
| - workingDirectory: tmpDir.path).then((ProcessResult processResult) { |
| - print(processResult.stdout); |
| - print(processResult.stderr); |
| - Expect.equals(0, processResult.exitCode, 'Unexpected exitCode from pub'); |
| + print("Copying '${sunflowerDir.path}' to '${tmpDir.path}'."); |
| + copyDirectory(sunflowerDir, tmpDir); |
| + String ext = Platform.isWindows ? '.bat' : ''; |
| + String command = path.normalize(path.join( |
| + path.fromUri(Platform.script), |
| + '../../../../sdk/bin/pub${ext}')); |
| + String file = path.join(tmpDir.path, 'build/web/sunflower.dart.js'); |
| + |
| + print("Running '$command get' from '${tmpDir}'."); |
| + ProcessResult getResult = await Process.run( |
| + command, ['get'], workingDirectory: tmpDir.path); |
| + print(getResult.stdout); |
|
Bill Hesse
2015/08/18 08:05:09
Perhaps put these print statements inside the chec
|
| + print(getResult.stderr); |
| + Expect.equals(0, getResult.exitCode, 'Unexpected exitCode from pub get'); |
| + |
| + print("Running '$command build --mode=debug' from '${tmpDir}'."); |
| + ProcessResult buildResult = await Process.run( |
| + command, ['build','--mode=debug'], workingDirectory: tmpDir.path); |
| + print(buildResult.stdout); |
| + print(buildResult.stderr); |
| + Expect.equals(0, buildResult.exitCode, 'Unexpected exitCode from pub'); |
| validateSourceMap(new Uri.file(file, windows: Platform.isWindows)); |
| print("Deleting '${tmpDir.path}'."); |
| + } finally { |
| tmpDir.deleteSync(recursive: true); |
| - }); |
| + } |
| })); |
|
Bill Hesse
2015/08/18 09:41:25
Extra parenthesis.
|
| } |