| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Test that the compiler can handle imports when package root has not been set. | 5 // Test that the compiler can handle imports when package root has not been set. |
| 6 | 6 |
| 7 library dart2js.test.package_root; | 7 library dart2js.test.package_root; |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 void main() { | 52 void main() { |
| 53 asyncTest(() async { | 53 asyncTest(() async { |
| 54 Uri script = currentDirectory.resolveUri(Platform.script); | 54 Uri script = currentDirectory.resolveUri(Platform.script); |
| 55 Uri packageRoot = script.resolve('./packages/'); | 55 Uri packageRoot = script.resolve('./packages/'); |
| 56 | 56 |
| 57 PackagesDiscoveryProvider noPackagesDiscovery = (Uri uri) { | 57 PackagesDiscoveryProvider noPackagesDiscovery = (Uri uri) { |
| 58 return new Future.value(Packages.noPackages); | 58 return new Future.value(Packages.noPackages); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 await runTest(Uri.parse('memory:main.dart'), MessageKind.READ_SCRIPT_ERROR, | 61 await runTest(Uri.parse('memory:main.dart'), MessageKind.READ_URI_ERROR, |
| 62 packageRoot: packageRoot); | 62 packageRoot: packageRoot); |
| 63 await runTest(Uri.parse('memory:main.dart'), MessageKind.LIBRARY_NOT_FOUND, | 63 await runTest(Uri.parse('memory:main.dart'), MessageKind.LIBRARY_NOT_FOUND, |
| 64 packageConfig: PACKAGE_CONFIG_URI); | 64 packageConfig: PACKAGE_CONFIG_URI); |
| 65 await runTest(Uri.parse('memory:main.dart'), MessageKind.LIBRARY_NOT_FOUND, | 65 await runTest(Uri.parse('memory:main.dart'), MessageKind.LIBRARY_NOT_FOUND, |
| 66 packagesDiscoveryProvider: noPackagesDiscovery); | 66 packagesDiscoveryProvider: noPackagesDiscovery); |
| 67 | 67 |
| 68 await runTest( | 68 await runTest( |
| 69 Uri.parse('package:foo/foo.dart'), MessageKind.READ_SELF_ERROR, | 69 Uri.parse('package:foo/foo.dart'), MessageKind.READ_SELF_ERROR, |
| 70 packageRoot: packageRoot); | 70 packageRoot: packageRoot); |
| 71 await runTest( | 71 await runTest( |
| 72 Uri.parse('package:foo/foo.dart'), MessageKind.LIBRARY_NOT_FOUND, | 72 Uri.parse('package:foo/foo.dart'), MessageKind.LIBRARY_NOT_FOUND, |
| 73 packageConfig: PACKAGE_CONFIG_URI); | 73 packageConfig: PACKAGE_CONFIG_URI); |
| 74 await runTest( | 74 await runTest( |
| 75 Uri.parse('package:foo/foo.dart'), MessageKind.LIBRARY_NOT_FOUND, | 75 Uri.parse('package:foo/foo.dart'), MessageKind.LIBRARY_NOT_FOUND, |
| 76 packagesDiscoveryProvider: noPackagesDiscovery); | 76 packagesDiscoveryProvider: noPackagesDiscovery); |
| 77 }); | 77 }); |
| 78 } | 78 } |
| OLD | NEW |