| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 | 7 |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'package:compiler/src/dart2js.dart' as entry; | 9 import 'package:compiler/src/dart2js.dart' as entry; |
| 10 import 'package:compiler/src/apiimpl.dart'; | 10 import 'package:compiler/src/apiimpl.dart'; |
| 11 import 'package:compiler/compiler_new.dart'; | 11 import 'package:compiler/compiler_new.dart'; |
| 12 | 12 |
| 13 import 'source_map_validator_helper.dart'; | 13 import 'source_map_validator_helper.dart'; |
| 14 | 14 |
| 15 void main() { | 15 void main() { |
| 16 String mainFile = | 16 String mainFile = |
| 17 'tests/compiler/dart2js/source_map_validator_test_file.dart'; | 17 'tests/compiler/dart2js/source_map_validator_test_file.dart'; |
| 18 asyncTest(() => createTempDir().then((Directory tmpDir) { | 18 asyncTest(() => createTempDir().then((Directory tmpDir) { |
| 19 print( | 19 print( |
| 20 'Compiling tests/compiler/dart2js/source_map_validator_test_file.dart'); | 20 'Compiling tests/compiler/dart2js/source_map_validator_test_file.dar
t'); |
| 21 Future<CompilationResult> result = entry.internalMain( | 21 Future<CompilationResult> result = entry.internalMain( |
| 22 [mainFile, | 22 [mainFile, '-o${tmpDir.path}/out.js', '--library-root=sdk']); |
| 23 '-o${tmpDir.path}/out.js', | 23 return result.then((CompilationResult result) { |
| 24 '--library-root=sdk']); | 24 CompilerImpl compiler = result.compiler; |
| 25 return result.then((CompilationResult result) { | 25 Uri uri = new Uri.file('${tmpDir.path}/out.js', |
| 26 CompilerImpl compiler = result.compiler; | 26 windows: Platform.isWindows); |
| 27 Uri uri = | 27 validateSourceMap(uri, |
| 28 new Uri.file('${tmpDir.path}/out.js', windows: Platform.isWindows); | 28 mainUri: Uri.base.resolve(mainFile), |
| 29 validateSourceMap(uri, | 29 mainPosition: const Position(13, 1), |
| 30 mainUri: Uri.base.resolve(mainFile), | 30 compiler: compiler); |
| 31 mainPosition: const Position(13, 1), | |
| 32 compiler: compiler); | |
| 33 | 31 |
| 34 print("Deleting '${tmpDir.path}'."); | 32 print("Deleting '${tmpDir.path}'."); |
| 35 tmpDir.deleteSync(recursive: true); | 33 tmpDir.deleteSync(recursive: true); |
| 36 }); | 34 }); |
| 37 })); | 35 })); |
| 38 } | 36 } |
| 39 | |
| OLD | NEW |