OLD | NEW |
(Empty) | |
| 1 import "dart:async"; |
| 2 import "dart:isolate"; |
| 3 import "package:expect/expect.dart"; |
| 4 |
| 5 main() { |
| 6 print("Spawning isolate."); |
| 7 var t = new Timer(new Duration(seconds:5), () { |
| 8 Expect.fail("Isolate was not spawned successfully."); |
| 9 }); |
| 10 var rp = new RawReceivePort(); |
| 11 rp.handler = (msg) { |
| 12 print("Spawned main called."); |
| 13 Expect.equals(msg, 50); |
| 14 rp.close(); |
| 15 }; |
| 16 Isolate.spawnUri(Uri.parse("spawn_uri_exported_main.dart"), null, rp.sendPort)
.then((_) { |
| 17 print("Loaded"); |
| 18 t.cancel(); |
| 19 }); |
| 20 } |
OLD | NEW |