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

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

Issue 190013005: Add Isolate.kill(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed naming and meaning of priorities Created 6 years, 9 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:isolate"; 5 import "dart:isolate";
6 import "dart:async"; 6 import "dart:async";
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import "package:async_helper/async_helper.dart"; 8 import "package:async_helper/async_helper.dart";
9 9
10 isomain1(replyPort) { 10 isomain1(replyPort) {
(...skipping 30 matching lines...) Expand all
41 }; 41 };
42 echoPort.send(4); 42 echoPort.send(4);
43 SendPort createPingPort(message) { 43 SendPort createPingPort(message) {
44 var pingPort = new RawReceivePort(); 44 var pingPort = new RawReceivePort();
45 pingPort.handler = (_) { 45 pingPort.handler = (_) {
46 result.add(message); 46 result.add(message);
47 pingPort.close(); 47 pingPort.close();
48 }; 48 };
49 return pingPort.sendPort; 49 return pingPort.sendPort;
50 } 50 }
51 isolate.ping(createPingPort("alive"), Isolate.PING_ALIVE); 51 isolate.ping(createPingPort("alive"), Isolate.OUT_OF_BAND);
52 echoPort.send(3); 52 echoPort.send(3);
53 isolate.ping(createPingPort("control"), Isolate.PING_CONTROL); 53 isolate.ping(createPingPort("control"), Isolate.BEFORE_NEXT_EVENT);
54 echoPort.send(2); 54 echoPort.send(2);
55 isolate.ping(createPingPort("event"), Isolate.PING_EVENT); 55 isolate.ping(createPingPort("event"), Isolate.AS_EVENT);
56 echoPort.send(1); 56 echoPort.send(1);
57 echoPort.send(0); 57 echoPort.send(0);
58 }); 58 });
59 }); 59 });
60 } 60 }
OLDNEW
« sdk/lib/_internal/lib/isolate_helper.dart ('K') | « tests/isolate/kill_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698