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

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

Issue 24631003: Add proper API for creating private symbols wrt a library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 2 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/intercepted_class_test.dart
diff --git a/tests/lib/mirrors/intercepted_class_test.dart b/tests/lib/mirrors/intercepted_class_test.dart
index 2fde1b71b9e128307f516d205241fb51313cf697..0eb227d33a862fac8ed48060c097a1d563a88b03 100644
--- a/tests/lib/mirrors/intercepted_class_test.dart
+++ b/tests/lib/mirrors/intercepted_class_test.dart
@@ -7,17 +7,28 @@
library test.intercepted_class_test;
import 'dart:mirrors';
+import 'package:expect/expect.dart';
import 'stringify.dart' show stringify, expect;
checkClassMirror(ClassMirror cls, String name) {
- expect('s($name)', cls.simpleName);
+ bool foundInterface = false;
+ for(ClassMirror cm = cls; cm != null; cm = cm.superclass) {
+ if (MirrorSystem.getName(cm.simpleName) == name) foundInterface = true;
+ cm.superinterfaces.forEach((intf) {
+ if (MirrorSystem.getName(intf.simpleName) == name) foundInterface = true;
+ });
+ }
+ Expect.isTrue(foundInterface, '$cls should implement $name');
+
var variables = new Map();
- cls.variables.forEach((Symbol key, VariableMirror value) {
- if (!value.isStatic && !value.isPrivate) {
- variables[key] = value;
- }
- });
+ for(ClassMirror cm = cls; cm != null; cm = cm.superclass) {
+ cm.variables.forEach((Symbol key, VariableMirror value) {
+ if (!value.isStatic && !value.isPrivate) {
+ variables[key] = value;
+ }
+ });
+ }
expect('{}', variables);
}

Powered by Google App Engine
This is Rietveld 408576698