OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // | 4 // |
5 // Dart test program for checking implemention of MirrorSystem when | 5 // Dart test program for checking implemention of MirrorSystem when |
6 // inspecting the current isolate. | 6 // inspecting the current isolate. |
7 // | 7 // |
8 // VMOptions=--enable_type_checks | 8 // VMOptions=--enable_type_checks |
9 | 9 |
10 #library('isolate_mirror_local_test'); | 10 #library('isolate_mirror_local_test'); |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 LibraryMirror mirror_lib = libraries['dart:mirrors']; | 297 LibraryMirror mirror_lib = libraries['dart:mirrors']; |
298 Expect.isTrue(mirror_lib is LibraryMirror); | 298 Expect.isTrue(mirror_lib is LibraryMirror); |
299 | 299 |
300 // Lookup an interface from a library and make sure it is sane. | 300 // Lookup an interface from a library and make sure it is sane. |
301 ClassMirror list_intf = core_lib.members['List']; | 301 ClassMirror list_intf = core_lib.members['List']; |
302 Expect.isTrue(list_intf is ClassMirror); | 302 Expect.isTrue(list_intf is ClassMirror); |
303 Expect.equals('List', list_intf.simpleName); | 303 Expect.equals('List', list_intf.simpleName); |
304 Expect.equals('dart:core.List', list_intf.qualifiedName); | 304 Expect.equals('dart:core.List', list_intf.qualifiedName); |
305 Expect.isFalse(list_intf.isPrivate); | 305 Expect.isFalse(list_intf.isPrivate); |
306 Expect.equals('Object', list_intf.superclass.simpleName); | 306 Expect.equals('Object', list_intf.superclass.simpleName); |
307 Expect.equals('ListImplementation', list_intf.defaultFactory.simpleName); | 307 Expect.equals('_ListImpl', list_intf.defaultFactory.simpleName); |
308 Expect.equals('dart:core', list_intf.owner.simpleName); | 308 Expect.equals('dart:core', list_intf.owner.simpleName); |
309 Expect.isFalse(list_intf.isClass); | 309 Expect.isFalse(list_intf.isClass); |
310 Expect.equals('Collection', list_intf.superinterfaces[0].simpleName); | 310 Expect.equals('Collection', list_intf.superinterfaces[0].simpleName); |
311 Expect.equals("ClassMirror on 'List'", list_intf.toString()); | 311 Expect.equals("ClassMirror on 'List'", list_intf.toString()); |
312 | 312 |
313 // Lookup a class from a library and make sure it is sane. | 313 // Lookup a class from a library and make sure it is sane. |
314 ClassMirror oom_cls = core_lib.members['OutOfMemoryError']; | 314 ClassMirror oom_cls = core_lib.members['OutOfMemoryError']; |
315 Expect.isTrue(oom_cls is ClassMirror); | 315 Expect.isTrue(oom_cls is ClassMirror); |
316 Expect.equals('OutOfMemoryError', oom_cls.simpleName); | 316 Expect.equals('OutOfMemoryError', oom_cls.simpleName); |
317 Expect.equals('dart:core.OutOfMemoryError', oom_cls.qualifiedName); | 317 Expect.equals('dart:core.OutOfMemoryError', oom_cls.qualifiedName); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 // Test that an isolate can reflect on itself. | 533 // Test that an isolate can reflect on itself. |
534 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); | 534 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); |
535 | 535 |
536 testIntegerInstanceMirror(reflect(1001)); | 536 testIntegerInstanceMirror(reflect(1001)); |
537 testStringInstanceMirror(reflect('This\nis\na\nString')); | 537 testStringInstanceMirror(reflect('This\nis\na\nString')); |
538 testBoolInstanceMirror(reflect(true)); | 538 testBoolInstanceMirror(reflect(true)); |
539 testNullInstanceMirror(reflect(null)); | 539 testNullInstanceMirror(reflect(null)); |
540 testCustomInstanceMirror(reflect(new MyClass(17))); | 540 testCustomInstanceMirror(reflect(new MyClass(17))); |
541 testMirrorErrors(currentMirrorSystem()); | 541 testMirrorErrors(currentMirrorSystem()); |
542 } | 542 } |
OLD | NEW |