| Index: tests/isolate/kill3_test.dart
|
| diff --git a/tests/isolate/ping_pause_test.dart b/tests/isolate/kill3_test.dart
|
| similarity index 64%
|
| copy from tests/isolate/ping_pause_test.dart
|
| copy to tests/isolate/kill3_test.dart
|
| index 11fa951f0af29a4ba4ac2dba37ffd4eab5a0f3e5..006f7aee9b4df273bc453c9d1202fbe1ee879eaf 100644
|
| --- a/tests/isolate/ping_pause_test.dart
|
| +++ b/tests/isolate/kill3_test.dart
|
| @@ -25,25 +25,20 @@ void main() {
|
| completer.future.then((echoPort) {
|
| reply.handler = (v) {
|
| result.add(v);
|
| - if (v == 0) {
|
| - Expect.listEquals([4, 3, 2, 1, 0], result);
|
| - reply.close();
|
| - asyncEnd();
|
| + echoPort.send(v - 1);
|
| + if (v == 2) {
|
| + isolate.kill(Isolate.AS_EVENT);
|
| }
|
| };
|
| + RawReceivePort exitSignal;
|
| + exitSignal = new RawReceivePort((_) {
|
| + Expect.listEquals([4, 3, 2, 1], result);
|
| + exitSignal.close();
|
| + reply.close();
|
| + asyncEnd();
|
| + });
|
| + isolate.addOnExitListener(exitSignal.sendPort);
|
| echoPort.send(4);
|
| - echoPort.send(3);
|
| - Capability resume = isolate.pause();
|
| - var pingPort = new RawReceivePort();
|
| - pingPort.handler = (_) {
|
| - Expect.isTrue(result.length <= 2);
|
| - echoPort.send(0);
|
| - isolate.resume(resume);
|
| - pingPort.close();
|
| - };
|
| - isolate.ping(pingPort.sendPort, Isolate.PING_CONTROL);
|
| - echoPort.send(2);
|
| - echoPort.send(1);
|
| });
|
| });
|
| }
|
|
|