Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 // | |
| 5 // Dart test program for checking implemention of IsolateMirror. | |
| 6 | |
| 7 #library('IsolateMirrorBusyTest'); | |
| 8 | |
| 9 #import('dart:mirrors'); | |
|
siva
2012/02/18 01:25:55
Since mirrors are part of the corelib at least in
turnidge
2012/03/07 20:00:14
Has your opinion on this changed after the recent
siva
2012/03/08 22:24:02
We are treating 'dart:mirrors' as an external libr
| |
| 10 | |
| 11 class BusyIsolate extends Isolate { | |
| 12 void busy() { | |
| 13 // TODO(turnidge): Get rid of this function once we check for | |
| 14 // interrupts on backwards branches. | |
| 15 } | |
| 16 void main() { | |
| 17 while (true) { | |
| 18 busy(); | |
| 19 } | |
| 20 } | |
| 21 } | |
| 22 | |
| 23 void testIsolateMirror(port) { | |
| 24 isolateMirrorOf(port).then((IsolateMirror mirror) { | |
| 25 Expect.isTrue(mirror.debugName.contains("BusyIsolate")); | |
| 26 }); | |
| 27 } | |
| 28 | |
| 29 void main() { | |
| 30 // Test that I can reflect on a busy isolate. | |
| 31 new BusyIsolate().spawn().then(testIsolateMirror); | |
| 32 } | |
| OLD | NEW |