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

Unified Diff: tests/compiler/dart2js_extra/reflect_native_types_test.dart

Issue 149533003: Reapply "Make reflectClassByName work with interceptor names." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update test expectations. Created 6 years, 11 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
« no previous file with comments | « sdk/lib/_internal/lib/js_mirrors.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js_extra/reflect_native_types_test.dart
diff --git a/tests/compiler/dart2js_extra/reflect_native_types_test.dart b/tests/compiler/dart2js_extra/reflect_native_types_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..4cd8f2693ace657e81efb5c1615055cedc1e18c5
--- /dev/null
+++ b/tests/compiler/dart2js_extra/reflect_native_types_test.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2014, 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.
+
+// Test that reflection works on intercepted types.
+
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
+
+main() {
+ // Make sure that reflecting on values of intercepted/native classes does
+ // not crash.
+ var intMembers = reflect(123).type.instanceMembers;
+ Expect.isTrue(intMembers.containsKey(#compareTo));
+ Expect.isTrue(intMembers.length > 15);
+ // TODO(karlklose): reenable after fixing dartbug.com/16389
+ // var listMembers = reflect([]).type.instanceMembers;
+ // Expect.isTrue(listMembers.containsKey(#join));
+ // Expect.isTrue(listMembers.length > 15);
+ var stringMembers = reflect('hest').type.instanceMembers;
+ Expect.isTrue(stringMembers.containsKey(#contains));
+ Expect.isTrue(stringMembers.length > 15);
+}
« no previous file with comments | « sdk/lib/_internal/lib/js_mirrors.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698