Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: tests/lib/mirrors/library_enumeration_deferred_loading_test.dart

Issue 1095903002: Deal with deferred loading in the VM mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/lib/mirrors/library_enumeration_deferred_loading_test.dart
diff --git a/tests/lib/mirrors/typedef_deferred_library_test.dart b/tests/lib/mirrors/library_enumeration_deferred_loading_test.dart
similarity index 52%
copy from tests/lib/mirrors/typedef_deferred_library_test.dart
copy to tests/lib/mirrors/library_enumeration_deferred_loading_test.dart
index 7dd6c2e347fd2c79861cabca27b72d6345dcce3e..05f3c30093aab0e0199fe18e3c50981f58dd718c 100644
--- a/tests/lib/mirrors/typedef_deferred_library_test.dart
+++ b/tests/lib/mirrors/library_enumeration_deferred_loading_test.dart
@@ -2,21 +2,22 @@
// 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 foo;
+library libray_enumeration_deferred_loading;
gbracha 2015/04/18 18:00:46 libray -> library
rmacnak 2015/04/20 17:21:04 Done.
-@MirrorsUsed(targets: const ["foo", "bar"])
import 'dart:mirrors';
-import 'typedef_library.dart' deferred as def;
-
-import 'package:async_helper/async_helper.dart';
import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+
+import 'other_library.dart' deferred as other;
main() {
+ var ms = currentMirrorSystem();
+ Expect.throws(() => ms.findLibrary(#test.other_library),
+ (e) => true, "should not be loaded yet");
+
asyncStart();
- def.loadLibrary().then((_) {
- var barLibrary = currentMirrorSystem().findLibrary(new Symbol("bar"));
- var gTypedef = barLibrary.declarations[new Symbol("G")];
- Expect.equals("G", MirrorSystem.getName(gTypedef.simpleName));
+ other.loadLibrary().then((_) {
asyncEnd();
+ Expect.isNotNull(ms.findLibrary(#test.other_library));
});
-}
+}
gbracha 2015/04/18 18:00:46 This is not exactly parallel to the other two (imp
rmacnak 2015/04/20 17:21:04 Filled in gap.

Powered by Google App Engine
This is Rietveld 408576698