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

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

Issue 8457005: convert isolates to use Future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated co19 Created 9 years, 1 month 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/MandelIsolateTest.dart ('k') | tests/isolate/src/Mixed2Test.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 // Things that should be "auto-generated" are between AUTO START and 5 // Things that should be "auto-generated" are between AUTO START and
6 // AUTO END (or just AUTO if it's a single line). 6 // AUTO END (or just AUTO if it's a single line).
7 7
8 8
9 class Mint { 9 class Mint {
10 Mint() : registry_ = new Map<SendPort, Purse>() { 10 Mint() : registry_ = new Map<SendPort, Purse>() {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 void makeMint(handleMint(MintWrapper mint)) { 177 void makeMint(handleMint(MintWrapper mint)) {
178 port_.then((SendPort port) { 178 port_.then((SendPort port) {
179 port.call(null).receive((var message, SendPort replyTo) { 179 port.call(null).receive((var message, SendPort replyTo) {
180 SendPort mint = message[0]; 180 SendPort mint = message[0];
181 handleMint(new MintWrapper(mint)); 181 handleMint(new MintWrapper(mint));
182 }); 182 });
183 }); 183 });
184 } 184 }
185 185
186 Promise<SendPort> port_; 186 Future<SendPort> port_;
187 } 187 }
188 188
189 189
190 class MintMakerTest { 190 class MintMakerTest {
191 static void testMain() { 191 static void testMain() {
192 MintMakerWrapper mintMaker = new MintMakerWrapper(); 192 MintMakerWrapper mintMaker = new MintMakerWrapper();
193 mintMaker.makeMint((MintWrapper mint) { 193 mintMaker.makeMint((MintWrapper mint) {
194 mint.createPurse(100, (PurseWrapper purse) { 194 mint.createPurse(100, (PurseWrapper purse) {
195 purse.queryBalance((int balance) { 195 purse.queryBalance((int balance) {
196 Expect.equals(100, balance); 196 Expect.equals(100, balance);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 Expect.equals(0 + 5 + 42, sprouted.queryBalance()); 263 Expect.equals(0 + 5 + 42, sprouted.queryBalance());
264 Expect.equals(100 - 5 - 42, purse.queryBalance()); 264 Expect.equals(100 - 5 - 42, purse.queryBalance());
265 } 265 }
266 */ 266 */
267 267
268 } 268 }
269 269
270 main() { 270 main() {
271 MintMakerTest.testMain(); 271 MintMakerTest.testMain();
272 } 272 }
OLDNEW
« no previous file with comments | « tests/isolate/src/MandelIsolateTest.dart ('k') | tests/isolate/src/Mixed2Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698