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

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

Issue 9652001: SendPort + ReceivePort changes: (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
« no previous file with comments | « tests/isolate/src/MintMakerTest.dart ('k') | tests/isolate/src/MixedTest.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 heavy and light isolates can be mixed. 5 // Dart test program for testing that heavy and light isolates can be mixed.
6 6
7 #library('Mixed2Test'); 7 #library('Mixed2Test');
8 #import("dart:isolate"); 8 #import("dart:isolate");
9 #import('TestFramework.dart'); 9 #import('TestFramework.dart');
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 } 108 }
109 109
110 void test(TestExpectation expect) { 110 void test(TestExpectation expect) {
111 Future<SendPort> heavy1 = expect.completes(new HeavyIsolate1().spawn()); 111 Future<SendPort> heavy1 = expect.completes(new HeavyIsolate1().spawn());
112 Future<SendPort> heavy2 = expect.completes(new HeavyIsolate2().spawn()); 112 Future<SendPort> heavy2 = expect.completes(new HeavyIsolate2().spawn());
113 Future<SendPort> heavy3 = expect.completes(new HeavyIsolate3().spawn()); 113 Future<SendPort> heavy3 = expect.completes(new HeavyIsolate3().spawn());
114 114
115 heavy2.then(expect.runs1((SendPort heavy2Port) { 115 heavy2.then(expect.runs1((SendPort heavy2Port) {
116 heavy3.then(expect.runs1((SendPort heavy3Port) { 116 heavy3.then(expect.runs1((SendPort heavy3Port) {
117 heavy2Port.call(heavy3Port).receive(expect.runs2((h2l1Port, ignored) { 117 heavy2Port.call(heavy3Port).then(expect.runs1((h2l1Port) {
118 heavy1.then(expect.runs1((SendPort heavy1Port) { 118 heavy1.then(expect.runs1((SendPort heavy1Port) {
119 heavy1Port.send(h2l1Port, null); 119 heavy1Port.send(h2l1Port, null);
120 // --------------- 120 // ---------------
121 // Setup complete. 121 // Setup complete.
122 // Start the chain-message. 122 // Start the chain-message.
123 heavy1Port.call(1).receive(expect.runs2((result, ignored) { 123 heavy1Port.call(1).then(expect.runs1((result) {
124 Expect.equals(6531, result); 124 Expect.equals(6531, result);
125 expect.succeeded(); 125 expect.succeeded();
126 })); 126 }));
127 })); 127 }));
128 })); 128 }));
129 })); 129 }));
130 })); 130 }));
131 } 131 }
132 132
133 main() { 133 main() {
134 runTests([test]); 134 runTests([test]);
135 } 135 }
OLDNEW
« no previous file with comments | « tests/isolate/src/MintMakerTest.dart ('k') | tests/isolate/src/MixedTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698