OLD | NEW |
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 // IsolateStubs=MintMakerFullyIsolatedTest.dart:Mint,Purse,PowerfulPurse | 5 // IsolateStubs=MintMakerFullyIsolatedTest.dart:Mint,Purse,PowerfulPurse |
6 #library("MintMakerFullyIsolatedTest-generatedTest"); | 6 #library("MintMakerFullyIsolatedTest-generatedTest"); |
7 #import("../../isolate/src/TestFramework.dart"); | 7 #import("../../isolate/src/TestFramework.dart"); |
8 | 8 |
9 interface Purse { | 9 interface Purse { |
10 Purse(); | 10 Purse(); |
11 int queryBalance(); | 11 int queryBalance(); |
12 Purse$Proxy sproutPurse(); | 12 Purse$Proxy sproutPurse(); |
13 // The deposit has not completed until the promise completes. If we | 13 // The deposit has not completed until the promise completes. If we |
14 // supported Promise<void> then this could use that. | 14 // supported Promise<void> then this could use that. |
15 Promise<int> deposit(int amount, Purse$Proxy source); | 15 Promise<int> deposit(int amount, Purse$Proxy source); |
16 } | 16 } |
17 | 17 |
18 interface PowerfulPurse extends Purse factory PurseImpl { | 18 interface PowerfulPurse extends Purse default PurseImpl { |
19 PowerfulPurse(); | 19 PowerfulPurse(); |
20 | 20 |
21 void init(Mint$Proxy mint, int balance); | 21 void init(Mint$Proxy mint, int balance); |
22 // Return an int so we can wait for it to complete. Shame we can't | 22 // Return an int so we can wait for it to complete. Shame we can't |
23 // have a Promise<void>. | 23 // have a Promise<void>. |
24 int grab(int amount); | 24 int grab(int amount); |
25 Purse weak(); | 25 Purse weak(); |
26 } | 26 } |
27 | 27 |
28 interface Mint factory MintImpl { | 28 interface Mint default MintImpl { |
29 Mint(); | 29 Mint(); |
30 | 30 |
31 Purse$Proxy createPurse(int balance); | 31 Purse$Proxy createPurse(int balance); |
32 Promise<PowerfulPurse$Proxy> promote(Purse$Proxy purse); | 32 Promise<PowerfulPurse$Proxy> promote(Purse$Proxy purse); |
33 } | 33 } |
34 | 34 |
35 // Because promises can't be used as keys in maps until they have | 35 // Because promises can't be used as keys in maps until they have |
36 // completed, provide a wrapper. Note that if any key promise fails to | 36 // completed, provide a wrapper. Note that if any key promise fails to |
37 // resolve, then get()'s return may also fail to resolve. Right now, a | 37 // resolve, then get()'s return may also fail to resolve. Right now, a |
38 // Proxy can also be used since it has (kludgily) been made to inherit | 38 // Proxy can also be used since it has (kludgily) been made to inherit |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 expect.succeeded(); | 289 expect.succeeded(); |
290 print("##DONE##"); | 290 print("##DONE##"); |
291 }); | 291 }); |
292 } | 292 } |
293 | 293 |
294 } | 294 } |
295 | 295 |
296 main() { | 296 main() { |
297 runTests([MintMakerFullyIsolatedTest.testMain]); | 297 runTests([MintMakerFullyIsolatedTest.testMain]); |
298 } | 298 } |
OLD | NEW |