Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016, 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 import "dart:isolate"; | |
| 6 import "dart:async"; | |
|
siva
2016/11/22 06:18:21
why is dart:async needed here?
rmacnak
2016/11/23 23:35:53
Removed
| |
| 7 import "package:expect/expect.dart"; | |
| 8 | |
| 9 class _Private { | |
| 10 String data; | |
| 11 _Private(this.data); | |
| 12 } | |
| 13 | |
| 14 void child(message) { | |
| 15 print("Got message: $message"); | |
| 16 SendPort replyPort = message[0]; | |
| 17 _Private object = message[1]; | |
| 18 Expect.isTrue(object is _Private); | |
| 19 Expect.equals("XYZ", object.data); | |
| 20 replyPort.send(object); | |
| 21 } | |
| 22 | |
| 23 void main() { | |
| 24 var port; | |
| 25 port = new RawReceivePort((message) { | |
| 26 print("Got reply: $message"); | |
| 27 Expect.isTrue(message is _Private); | |
| 28 Expect.equals("XYZ", message.data); | |
| 29 port.close(); | |
| 30 }); | |
| 31 | |
| 32 Isolate.spawn(child, [port.sendPort, new _Private("XYZ")]); | |
| 33 } | |
|
siva
2016/11/22 06:18:21
You would have to skip this test in the status fil
rmacnak
2016/11/23 23:35:53
Done.
| |
| OLD | NEW |