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

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

Issue 10836241: Move unittest from lib to pkg. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « tests/isolate/unresolved_ports_negative_test.dart ('k') | tests/json/json_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // spawns multiple isolates and sends unresolved ports between them. 5 // spawns multiple isolates and sends unresolved ports between them.
6 #library('unresolved_ports'); 6 #library('unresolved_ports');
7 #import('dart:isolate'); 7 #import('dart:isolate');
8 #import('../../lib/unittest/unittest.dart'); 8 #import('../../pkg/unittest/unittest.dart');
9 9
10 // This test does the following: 10 // This test does the following:
11 // - main spawns two isolates: 'tim' and 'beth' 11 // - main spawns two isolates: 'tim' and 'beth'
12 // - 'tim' spawns an isolate: 'bob' 12 // - 'tim' spawns an isolate: 'bob'
13 // - main starts a message chain: 13 // - main starts a message chain:
14 // main -> beth -> tim -> bob -> main 14 // main -> beth -> tim -> bob -> main
15 // by giving 'beth' a send-port to 'tim'. 15 // by giving 'beth' a send-port to 'tim'.
16 16
17 bethIsolate() { 17 bethIsolate() {
18 port.receive((msg, reply) => msg[1].send( 18 port.receive((msg, reply) => msg[1].send(
(...skipping 25 matching lines...) Expand all
44 SendPort tim = spawnFunction(timIsolate); 44 SendPort tim = spawnFunction(timIsolate);
45 SendPort beth = spawnFunction(bethIsolate); 45 SendPort beth = spawnFunction(bethIsolate);
46 46
47 beth.send( 47 beth.send(
48 // because tim is created asynchronously, here we are sending an 48 // because tim is created asynchronously, here we are sending an
49 // unresolved port: 49 // unresolved port:
50 ['main says: Beth, find out if Tim is coming.', tim], 50 ['main says: Beth, find out if Tim is coming.', tim],
51 port.toSendPort()); 51 port.toSendPort());
52 }); 52 });
53 } 53 }
OLDNEW
« no previous file with comments | « tests/isolate/unresolved_ports_negative_test.dart ('k') | tests/json/json_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698