| OLD | NEW |
| 1 // Copyright (c) 2016, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 // Test that we get a meaningful list of processes. | 5 // Test that we get a meaningful list of processes. |
| 6 | 6 |
| 7 // DartinoDebuggerCommands=b resume,r,c | 7 // DartinoDebuggerCommands=b resume,r,c,q |
| 8 | 8 |
| 9 import 'dart:dartino'; | 9 import 'dart:dartino'; |
| 10 | 10 |
| 11 Port spawnPaused(Channel channel) { | 11 Port spawnPaused(Channel channel) { |
| 12 var port = new Port(channel); | 12 var port = new Port(channel); |
| 13 Process.spawnDetached(() { | 13 Process.spawnDetached(() { |
| 14 var c = new Channel(); | 14 var c = new Channel(); |
| 15 port.send(new Port(c)); | 15 port.send(new Port(c)); |
| 16 c.receive(); | 16 c.receive(); |
| 17 }); | 17 }); |
| 18 return channel.receive(); | 18 return channel.receive(); |
| 19 } | 19 } |
| 20 | 20 |
| 21 void resume(Channel channel, Port port) { | 21 void resume(Channel channel, Port port) { |
| 22 port.send(null); | 22 port.send(null); |
| 23 } | 23 } |
| 24 | 24 |
| 25 main() { | 25 main() { |
| 26 Channel channel = new Channel(); | 26 Channel channel = new Channel(); |
| 27 Port p = spawnPaused(channel); | 27 Port p = spawnPaused(channel); |
| 28 resume(channel, p); | 28 resume(channel, p); |
| 29 } | 29 } |
| OLD | NEW |