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

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

Issue 218273002: Upgrading tests with unittest deprecations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 // Dart test program for testing that isolates can spawn other isolates and 5 // Dart test program for testing that isolates can spawn other isolates and
6 // that the nested isolates can communicate with the main once the spawner has 6 // that the nested isolates can communicate with the main once the spawner has
7 // disappeared. 7 // disappeared.
8 8
9 library NestedSpawn2Test; 9 library NestedSpawn2Test;
10 import 'dart:isolate'; 10 import 'dart:isolate';
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 })); 50 }));
51 })); 51 }));
52 })); 52 }));
53 } 53 }
54 54
55 void main([args, port]) { 55 void main([args, port]) {
56 if (testRemote(main, port)) return; 56 if (testRemote(main, port)) return;
57 test("spawned isolate can spawn other isolates", () { 57 test("spawned isolate can spawn other isolates", () {
58 ReceivePort init = new ReceivePort(); 58 ReceivePort init = new ReceivePort();
59 Isolate.spawn(isolateA, init.sendPort); 59 Isolate.spawn(isolateA, init.sendPort);
60 init.first.then(expectAsync1((port) { 60 init.first.then(expectAsync((port) {
61 _call(port, "launch nested!", expectAsync2((msg, replyTo) { 61 _call(port, "launch nested!", expectAsync((msg, replyTo) {
62 expect(msg[0], "0"); 62 expect(msg[0], "0");
63 _call(replyTo, msg1, expectAsync2((msg, replyTo) { 63 _call(replyTo, msg1, expectAsync((msg, replyTo) {
64 expect(msg[0], "2"); 64 expect(msg[0], "2");
65 _call(replyTo, msg3, expectAsync2((msg, replyTo) { 65 _call(replyTo, msg3, expectAsync((msg, replyTo) {
66 expect(msg[0], "4"); 66 expect(msg[0], "4");
67 _call(replyTo, msg5, expectAsync2((msg, _) { 67 _call(replyTo, msg5, expectAsync((msg, _) {
68 expect(msg[0], "6"); 68 expect(msg[0], "6");
69 })); 69 }));
70 })); 70 }));
71 })); 71 }));
72 })); 72 }));
73 })); 73 }));
74 }); 74 });
75 } 75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698