| 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; |
| 11 | 11 |
| 12 import "package:expect/expect.dart"; | |
| 13 import 'dart:async'; | 12 import 'dart:async'; |
| 14 import 'dart:isolate'; | 13 import 'dart:isolate'; |
| 15 import 'dart:mirrors'; | 14 import 'dart:mirrors'; |
| 16 | 15 |
| 17 ReceivePort exit_port; | 16 ReceivePort exit_port; |
| 18 Set expectedTests; | 17 Set expectedTests; |
| 19 | 18 |
| 20 void testDone(String test) { | 19 void testDone(String test) { |
| 21 if (!expectedTests.contains(test)) { | 20 if (!expectedTests.contains(test)) { |
| 22 throw "Unexpected test name '$test'"; | 21 throw "Unexpected test name '$test'"; |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 // Test that an isolate can reflect on itself. | 521 // Test that an isolate can reflect on itself. |
| 523 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); | 522 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); |
| 524 | 523 |
| 525 testIntegerInstanceMirror(reflect(1001)); | 524 testIntegerInstanceMirror(reflect(1001)); |
| 526 testStringInstanceMirror(reflect('This\nis\na\nString')); | 525 testStringInstanceMirror(reflect('This\nis\na\nString')); |
| 527 testBoolInstanceMirror(reflect(true)); | 526 testBoolInstanceMirror(reflect(true)); |
| 528 testNullInstanceMirror(reflect(null)); | 527 testNullInstanceMirror(reflect(null)); |
| 529 testCustomInstanceMirror(reflect(new MyClass(17))); | 528 testCustomInstanceMirror(reflect(new MyClass(17))); |
| 530 testMirrorErrors(currentMirrorSystem()); | 529 testMirrorErrors(currentMirrorSystem()); |
| 531 } | 530 } |
| OLD | NEW |