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

Side by Side Diff: tests/isolate/src/APIv2_unresolvedPortsStandaloneNegativeTest.dart

Issue 9422019: isolates refactor: this change introduces 'dart:isolate' as a library. This is a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // A negative test to ensure we are covering all the assertions and running to 5 // A negative test to ensure we are covering all the assertions and running to
6 // completion APIv2_unresolvedPortsStandaloneTest. 6 // completion APIv2_unresolvedPortsStandaloneTest.
7 #library('unresolved_ports'); 7 #library('unresolved_ports');
8 #import('dart:isolate');
8 9
9 bethIsolate(ReceivePort port) { 10 bethIsolate(ReceivePort port) {
10 port.receive((msg, reply) => msg[1].send( 11 port.receive((msg, reply) => msg[1].send(
11 "${msg[0]}\nBeth says: Tim are you coming? And Bob?", reply)); 12 "${msg[0]}\nBeth says: Tim are you coming? And Bob?", reply));
12 } 13 }
13 14
14 timIsolate(ReceivePort port) { 15 timIsolate(ReceivePort port) {
15 Isolate2 bob = new Isolate2.fromCode(bobIsolate); 16 Isolate2 bob = new Isolate2.fromCode(bobIsolate);
16 port.receive((msg, reply) => bob.sendPort.send( 17 port.receive((msg, reply) => bob.sendPort.send(
17 "$msg\nTim says: Can you tell 'main' that we are all coming?", reply)); 18 "$msg\nTim says: Can you tell 'main' that we are all coming?", reply));
(...skipping 16 matching lines...) Expand all
34 35
35 Isolate2 tim = new Isolate2.fromCode(timIsolate); 36 Isolate2 tim = new Isolate2.fromCode(timIsolate);
36 Isolate2 beth = new Isolate2.fromCode(bethIsolate); 37 Isolate2 beth = new Isolate2.fromCode(bethIsolate);
37 38
38 beth.sendPort.send( 39 beth.sendPort.send(
39 // because tim is created asynchronously, here we are sending an 40 // because tim is created asynchronously, here we are sending an
40 // unresolved port: 41 // unresolved port:
41 ["main says: Beth, find out if Tim is coming.", tim.sendPort], 42 ["main says: Beth, find out if Tim is coming.", tim.sendPort],
42 port.toSendPort()); 43 port.toSendPort());
43 } 44 }
OLDNEW
« no previous file with comments | « tests/isolate/src/APIv2_unresolvedPortsBrowserTest.dart ('k') | tests/isolate/src/APIv2_unresolvedPortsStandaloneTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698