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 library reexport_handled_test; | 5 library reexport_handled_test; |
6 | 6 |
7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
8 import "package:async_helper/async_helper.dart"; | 8 import "package:async_helper/async_helper.dart"; |
9 import 'mock_compiler.dart'; | 9 import 'mock_compiler.dart'; |
10 import 'package:compiler/src/elements/elements.dart' | 10 import 'package:compiler/src/elements/elements.dart' |
(...skipping 12 matching lines...) Expand all Loading... |
23 '''; | 23 '''; |
24 | 24 |
25 void main() { | 25 void main() { |
26 MockCompiler compiler; | 26 MockCompiler compiler; |
27 asyncTest(() => MockCompiler.create((MockCompiler c) { | 27 asyncTest(() => MockCompiler.create((MockCompiler c) { |
28 compiler = c; | 28 compiler = c; |
29 compiler.registerSource(exportingLibraryUri, EXPORTING_LIBRARY_SOURCE); | 29 compiler.registerSource(exportingLibraryUri, EXPORTING_LIBRARY_SOURCE); |
30 compiler.registerSource( | 30 compiler.registerSource( |
31 reexportingLibraryUri, REEXPORTING_LIBRARY_SOURCE); | 31 reexportingLibraryUri, REEXPORTING_LIBRARY_SOURCE); |
32 return compiler.libraryLoader.loadLibrary(exportingLibraryUri); | 32 return compiler.libraryLoader.loadLibrary(exportingLibraryUri); |
33 }).then((exportingLibrary) { | 33 }).then((loadedLibraries) { |
| 34 compiler.processLoadedLibraries(loadedLibraries); |
| 35 var exportingLibrary = loadedLibraries.rootLibrary; |
34 Expect.isTrue(exportingLibrary.exportsHandled); | 36 Expect.isTrue(exportingLibrary.exportsHandled); |
35 var foo = exportingLibrary.findExported('foo'); | 37 var foo = exportingLibrary.findExported('foo'); |
36 Expect.isNotNull(foo); | 38 Expect.isNotNull(foo); |
37 Expect.isTrue(foo.isField); | 39 Expect.isTrue(foo.isField); |
38 | 40 |
39 // Load reexporting library when exports are handled on the exporting li
brary. | 41 // Load reexporting library when exports are handled on the exporting li
brary. |
40 return compiler.libraryLoader.loadLibrary(reexportingLibraryUri); | 42 return compiler.libraryLoader.loadLibrary(reexportingLibraryUri); |
41 }).then((reexportingLibrary) { | 43 }).then((loadedLibraries) { |
42 var foo = reexportingLibrary.findExported('foo'); | 44 compiler.processLoadedLibraries(loadedLibraries); |
| 45 var foo = loadedLibraries.rootLibrary.findExported('foo'); |
43 Expect.isNotNull(foo); | 46 Expect.isNotNull(foo); |
44 Expect.isTrue(foo.isField); | 47 Expect.isTrue(foo.isField); |
45 })); | 48 })); |
46 } | 49 } |
OLD | NEW |