| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 301 |
| 302 // Lookup an interface from a library and make sure it is sane. | 302 // Lookup an interface from a library and make sure it is sane. |
| 303 ClassMirror list_intf = core_lib.members['List']; | 303 ClassMirror list_intf = core_lib.members['List']; |
| 304 Expect.isTrue(list_intf is ClassMirror); | 304 Expect.isTrue(list_intf is ClassMirror); |
| 305 Expect.equals('List', list_intf.simpleName); | 305 Expect.equals('List', list_intf.simpleName); |
| 306 Expect.equals('dart.core.List', list_intf.qualifiedName); | 306 Expect.equals('dart.core.List', list_intf.qualifiedName); |
| 307 Expect.isFalse(list_intf.isPrivate); | 307 Expect.isFalse(list_intf.isPrivate); |
| 308 Expect.equals('Object', list_intf.superclass.simpleName); | 308 Expect.equals('Object', list_intf.superclass.simpleName); |
| 309 Expect.equals('dart.core', list_intf.owner.simpleName); | 309 Expect.equals('dart.core', list_intf.owner.simpleName); |
| 310 Expect.isTrue(list_intf.isClass); | 310 Expect.isTrue(list_intf.isClass); |
| 311 Expect.equals('Collection', list_intf.superinterfaces[0].simpleName); | 311 Expect.equals('Iterable', list_intf.superinterfaces[0].simpleName); |
| 312 Expect.equals("ClassMirror on 'List'", list_intf.toString()); | 312 Expect.equals("ClassMirror on 'List'", list_intf.toString()); |
| 313 | 313 |
| 314 // Lookup a class from a library and make sure it is sane. | 314 // Lookup a class from a library and make sure it is sane. |
| 315 ClassMirror oom_cls = core_lib.members['OutOfMemoryError']; | 315 ClassMirror oom_cls = core_lib.members['OutOfMemoryError']; |
| 316 Expect.isTrue(oom_cls is ClassMirror); | 316 Expect.isTrue(oom_cls is ClassMirror); |
| 317 Expect.equals('OutOfMemoryError', oom_cls.simpleName); | 317 Expect.equals('OutOfMemoryError', oom_cls.simpleName); |
| 318 Expect.equals('dart.core.OutOfMemoryError', oom_cls.qualifiedName); | 318 Expect.equals('dart.core.OutOfMemoryError', oom_cls.qualifiedName); |
| 319 Expect.isFalse(oom_cls.isPrivate); | 319 Expect.isFalse(oom_cls.isPrivate); |
| 320 Expect.equals('Object', oom_cls.superclass.simpleName); | 320 Expect.equals('Object', oom_cls.superclass.simpleName); |
| 321 Expect.isTrue(oom_cls.defaultFactory == null); | 321 Expect.isTrue(oom_cls.defaultFactory == null); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 // Test that an isolate can reflect on itself. | 522 // Test that an isolate can reflect on itself. |
| 523 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); | 523 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); |
| 524 | 524 |
| 525 testIntegerInstanceMirror(reflect(1001)); | 525 testIntegerInstanceMirror(reflect(1001)); |
| 526 testStringInstanceMirror(reflect('This\nis\na\nString')); | 526 testStringInstanceMirror(reflect('This\nis\na\nString')); |
| 527 testBoolInstanceMirror(reflect(true)); | 527 testBoolInstanceMirror(reflect(true)); |
| 528 testNullInstanceMirror(reflect(null)); | 528 testNullInstanceMirror(reflect(null)); |
| 529 testCustomInstanceMirror(reflect(new MyClass(17))); | 529 testCustomInstanceMirror(reflect(new MyClass(17))); |
| 530 testMirrorErrors(currentMirrorSystem()); | 530 testMirrorErrors(currentMirrorSystem()); |
| 531 } | 531 } |
| OLD | NEW |