| 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 testing that isolates can spawn other isolates and | 5 // Dart test program for testing that isolates can spawn other isolates and |
| 6 // that the nested isolates can communicate with the main once the spawner has | 6 // that the nested isolates can communicate with the main once the spawner has |
| 7 // disappeared. | 7 // disappeared. |
| 8 | 8 |
| 9 #library('NestedSpawn2Test'); | 9 #library('NestedSpawn2Test'); |
| 10 #import("dart:isolate"); | 10 #import("dart:isolate"); |
| 11 #import('../../lib/unittest/unittest.dart'); | 11 #import('../../pkg/unittest/unittest.dart'); |
| 12 | 12 |
| 13 void isolateA() { | 13 void isolateA() { |
| 14 port.receive((msg, replyTo) { | 14 port.receive((msg, replyTo) { |
| 15 Expect.equals("launch nested!", msg); | 15 Expect.equals("launch nested!", msg); |
| 16 SendPort p = spawnFunction(isolateB); | 16 SendPort p = spawnFunction(isolateB); |
| 17 p.send(replyTo, null); | 17 p.send(replyTo, null); |
| 18 port.close(); | 18 port.close(); |
| 19 }); | 19 }); |
| 20 } | 20 } |
| 21 | 21 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 _call(replyTo, msg3, expectAsync2((msg, replyTo) { | 64 _call(replyTo, msg3, expectAsync2((msg, replyTo) { |
| 65 Expect.equals("4", msg[0]); | 65 Expect.equals("4", msg[0]); |
| 66 _call(replyTo, msg5, expectAsync2((msg, replyTo) { | 66 _call(replyTo, msg5, expectAsync2((msg, replyTo) { |
| 67 Expect.equals("6", msg[0]); | 67 Expect.equals("6", msg[0]); |
| 68 })); | 68 })); |
| 69 })); | 69 })); |
| 70 })); | 70 })); |
| 71 })); | 71 })); |
| 72 }); | 72 }); |
| 73 } | 73 } |
| OLD | NEW |