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

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

Issue 70103014: Make isolate tests work on drt (and hopefully dartium). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Retain isolate_stress_test in status file Created 7 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 | Annotate | Revision Log
« no previous file with comments | « tests/isolate/nested_spawn2_test.dart ('k') | tests/isolate/raw_port_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 // Dart test program for testing that isolates can spawn other isolates. 5 // Dart test program for testing that isolates can spawn other isolates.
6 6
7 library NestedSpawnTest; 7 library NestedSpawnTest;
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 import '../../pkg/unittest/lib/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import "remote_unittest_helper.dart";
10 11
11 void isolateA(message) { 12 void isolateA(message) {
12 message.add("isolateA"); 13 message.add("isolateA");
13 Isolate.spawn(isolateB, message); 14 Isolate.spawn(isolateB, message);
14 } 15 }
15 16
16 void isolateB(message) { 17 void isolateB(message) {
17 message.add("isolateB"); 18 message.add("isolateB");
18 message[0].send(message); 19 message[0].send(message);
19 } 20 }
20 21
21 main() { 22 void main([args, port]) {
23 if (testRemote(main, port)) return;
22 test("spawned isolates can spawn nested isolates", () { 24 test("spawned isolates can spawn nested isolates", () {
23 ReceivePort port = new ReceivePort(); 25 ReceivePort port = new ReceivePort();
24 Isolate.spawn(isolateA, [port.sendPort, "main"]); 26 Isolate.spawn(isolateA, [port.sendPort, "main"]);
25 port.first.then((message) { 27 port.first.then((message) {
26 expect("main", message[1]); 28 expect("main", message[1]);
27 expect("isolateA", message[2]); 29 expect("isolateA", message[2]);
28 expect("isolateB", message[3]); 30 expect("isolateB", message[3]);
29 }); 31 });
30 }); 32 });
31 } 33 }
OLDNEW
« no previous file with comments | « tests/isolate/nested_spawn2_test.dart ('k') | tests/isolate/raw_port_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698