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

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

Issue 148223008: Make reflectClassByName work with interceptor names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update lib 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..eb2cb355003063cc7161853ecccdedb3ca7255f1
--- /dev/null
+++ b/tests/compiler/dart2js_extra/reflect_native_types_test.dart
@@ -0,0 +1,22 @@
+// 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);
+ 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