| 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 #library('isolate_mirror_local_test'); | 8 #library('isolate_mirror_local_test'); |
| 9 | 9 |
| 10 #import('dart:isolate'); | 10 #import('dart:isolate'); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 LibraryMirror mirror_lib = libraries['dart:mirrors']; | 258 LibraryMirror mirror_lib = libraries['dart:mirrors']; |
| 259 Expect.isTrue(mirror_lib is LibraryMirror); | 259 Expect.isTrue(mirror_lib is LibraryMirror); |
| 260 | 260 |
| 261 // Lookup an interface from a library and make sure it is sane. | 261 // Lookup an interface from a library and make sure it is sane. |
| 262 ClassMirror list_intf = core_lib.members['List']; | 262 ClassMirror list_intf = core_lib.members['List']; |
| 263 Expect.isTrue(list_intf is ClassMirror); | 263 Expect.isTrue(list_intf is ClassMirror); |
| 264 Expect.equals('List', list_intf.simpleName); | 264 Expect.equals('List', list_intf.simpleName); |
| 265 Expect.equals('dart:core.List', list_intf.qualifiedName); | 265 Expect.equals('dart:core.List', list_intf.qualifiedName); |
| 266 Expect.isFalse(list_intf.isPrivate); | 266 Expect.isFalse(list_intf.isPrivate); |
| 267 Expect.equals('Object', list_intf.superclass.simpleName); | 267 Expect.equals('Object', list_intf.superclass.simpleName); |
| 268 Expect.equals('ListFactory', list_intf.defaultFactory.simpleName); | 268 Expect.equals('ListImplementation', list_intf.defaultFactory.simpleName); |
| 269 Expect.equals('dart:core', list_intf.owner.simpleName); | 269 Expect.equals('dart:core', list_intf.owner.simpleName); |
| 270 Expect.isFalse(list_intf.isClass); | 270 Expect.isFalse(list_intf.isClass); |
| 271 Expect.equals('Collection', list_intf.superinterfaces[0].simpleName); | 271 Expect.equals('Collection', list_intf.superinterfaces[0].simpleName); |
| 272 Expect.equals("ClassMirror on 'List'", list_intf.toString()); | 272 Expect.equals("ClassMirror on 'List'", list_intf.toString()); |
| 273 | 273 |
| 274 // Lookup a class from a library and make sure it is sane. | 274 // Lookup a class from a library and make sure it is sane. |
| 275 ClassMirror oom_cls = core_lib.members['OutOfMemoryException']; | 275 ClassMirror oom_cls = core_lib.members['OutOfMemoryException']; |
| 276 Expect.isTrue(oom_cls is ClassMirror); | 276 Expect.isTrue(oom_cls is ClassMirror); |
| 277 Expect.equals('OutOfMemoryException', oom_cls.simpleName); | 277 Expect.equals('OutOfMemoryException', oom_cls.simpleName); |
| 278 Expect.equals('dart:core.OutOfMemoryException', oom_cls.qualifiedName); | 278 Expect.equals('dart:core.OutOfMemoryException', oom_cls.qualifiedName); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 // Test that an isolate can reflect on itself. | 488 // Test that an isolate can reflect on itself. |
| 489 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); | 489 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); |
| 490 | 490 |
| 491 testIntegerInstanceMirror(reflect(1001)); | 491 testIntegerInstanceMirror(reflect(1001)); |
| 492 testStringInstanceMirror(reflect('This\nis\na\nString')); | 492 testStringInstanceMirror(reflect('This\nis\na\nString')); |
| 493 testBoolInstanceMirror(reflect(true)); | 493 testBoolInstanceMirror(reflect(true)); |
| 494 testNullInstanceMirror(reflect(null)); | 494 testNullInstanceMirror(reflect(null)); |
| 495 testCustomInstanceMirror(reflect(new MyClass(17))); | 495 testCustomInstanceMirror(reflect(new MyClass(17))); |
| 496 testMirrorErrors(currentMirrorSystem()); | 496 testMirrorErrors(currentMirrorSystem()); |
| 497 } | 497 } |
| OLD | NEW |