Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: tests/isolate/send_private_test.dart

Issue 2509413002: An isolate created with spawn function doesn't necessarily agree with its parent on the library pri… (Closed)
Patch Set: . Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/isolate/isolate.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 "package:expect/expect.dart";
7
8 class _Private {
9 String data;
10 _Private(this.data);
11 }
12
13 void child(message) {
14 print("Got message: $message");
15 SendPort replyPort = message[0];
16 _Private object = message[1];
17 Expect.isTrue(object is _Private);
18 Expect.equals("XYZ", object.data);
19 replyPort.send(object);
20 }
21
22 void main() {
23 var port;
24 port = new RawReceivePort((message) {
25 print("Got reply: $message");
26 Expect.isTrue(message is _Private);
27 Expect.equals("XYZ", message.data);
28 port.close();
29 });
30
31 Isolate.spawn(child, [port.sendPort, new _Private("XYZ")]);
32 }
OLDNEW
« no previous file with comments | « tests/isolate/isolate.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698