Index: tests/lib/mirrors/library_import_deferred_loading_test.dart |
diff --git a/tests/lib/mirrors/library_import_deferred_loading_test.dart b/tests/lib/mirrors/library_import_deferred_loading_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dbd02527c1f7c1806df61ff8cb34f9ae9a224596 |
--- /dev/null |
+++ b/tests/lib/mirrors/library_import_deferred_loading_test.dart |
@@ -0,0 +1,27 @@ |
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+library libray_loading_deferred_loading; |
gbracha
2015/04/18 18:00:46
libray -> library (this isn't deliberate is it?)
rmacnak
2015/04/20 17:21:04
Done.
|
+ |
+import 'dart:mirrors'; |
+import 'package:expect/expect.dart'; |
+import 'stringify.dart'; |
+import 'package:async_helper/async_helper.dart'; |
+ |
+import 'other_library.dart' deferred as other; |
+ |
+main() { |
+ var ms = currentMirrorSystem(); |
+ LibraryMirror thisLibrary = ms.findLibrary(#libray_loading_deferred_loading); |
+ LibraryDependencyMirror dep = |
+ thisLibrary.libraryDependencies.singleWhere((d) => d.prefix == #other); |
+ Expect.isNull(dep.targetLibrary, "should not be loaded yet"); |
+ |
+ asyncStart(); |
+ other.loadLibrary().then((_) { |
+ asyncEnd(); |
+ Expect.isNotNull(dep.targetLibrary); |
+ Expect.equals(#test.other_library, dep.targetLibrary.simpleName); |
gbracha
2015/04/18 18:00:46
So the load_library version also calls a method. W
rmacnak
2015/04/20 17:21:04
Added
|
+ }); |
+} |