| 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/implementation/dart2js.dart' as entry; | 9 import 'package:compiler/src/dart2js.dart' as entry; |
| 10 import 'package:compiler/implementation/apiimpl.dart'; | 10 import 'package:compiler/src/apiimpl.dart'; |
| 11 | 11 |
| 12 import 'source_map_validator_helper.dart'; | 12 import 'source_map_validator_helper.dart'; |
| 13 import 'compiler_alt.dart' as alt; | 13 import 'compiler_alt.dart' as alt; |
| 14 | 14 |
| 15 void main() { | 15 void main() { |
| 16 entry.compileFunc = alt.compile; | 16 entry.compileFunc = alt.compile; |
| 17 | 17 |
| 18 asyncTest(() => createTempDir().then((Directory tmpDir) { | 18 asyncTest(() => createTempDir().then((Directory tmpDir) { |
| 19 String file = | 19 String file = |
| 20 'tests/compiler/dart2js/source_map_deferred_validator_test_file.dart'; | 20 'tests/compiler/dart2js/source_map_deferred_validator_test_file.dart'; |
| 21 print("Compiling $file"); | 21 print("Compiling $file"); |
| 22 Future result = entry.internalMain( | 22 Future result = entry.internalMain( |
| 23 [file, | 23 [file, |
| 24 '-o${tmpDir.path}/out.js', | 24 '-o${tmpDir.path}/out.js', |
| 25 '--library-root=sdk']); | 25 '--library-root=sdk']); |
| 26 return result.then((_) { | 26 return result.then((_) { |
| 27 Compiler compiler = alt.compiler; | 27 Compiler compiler = alt.compiler; |
| 28 Uri mainUri = new Uri.file('${tmpDir.path}/out.js', | 28 Uri mainUri = new Uri.file('${tmpDir.path}/out.js', |
| 29 windows: Platform.isWindows); | 29 windows: Platform.isWindows); |
| 30 Uri deferredUri = new Uri.file('${tmpDir.path}/out.js_1.part.js', | 30 Uri deferredUri = new Uri.file('${tmpDir.path}/out.js_1.part.js', |
| 31 windows: Platform.isWindows); | 31 windows: Platform.isWindows); |
| 32 validateSourceMap(mainUri, compiler); | 32 validateSourceMap(mainUri, compiler); |
| 33 validateSourceMap(deferredUri, compiler); | 33 validateSourceMap(deferredUri, compiler); |
| 34 | 34 |
| 35 print("Deleting '${tmpDir.path}'."); | 35 print("Deleting '${tmpDir.path}'."); |
| 36 tmpDir.deleteSync(recursive: true); | 36 tmpDir.deleteSync(recursive: true); |
| 37 }); | 37 }); |
| 38 })); | 38 })); |
| 39 } | 39 } |
| OLD | NEW |