| 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 /* class = Purse (tests/stub-generator/src/MintMakerFullyIsolatedTest.dart/MintM
akerFullyIsolatedTest.dart: 9) */ | 9 /* class = Purse (tests/stub-generator/src/MintMakerFullyIsolatedTest.dart/MintM
akerFullyIsolatedTest.dart: 9) */ |
| 10 | 10 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 interface Purse { | 219 interface Purse { |
| 220 Purse(); | 220 Purse(); |
| 221 int queryBalance(); | 221 int queryBalance(); |
| 222 Purse$Proxy sproutPurse(); | 222 Purse$Proxy sproutPurse(); |
| 223 // The deposit has not completed until the promise completes. If we | 223 // The deposit has not completed until the promise completes. If we |
| 224 // supported Promise<void> then this could use that. | 224 // supported Promise<void> then this could use that. |
| 225 Promise<int> deposit(int amount, Purse$Proxy source); | 225 Promise<int> deposit(int amount, Purse$Proxy source); |
| 226 } | 226 } |
| 227 | 227 |
| 228 interface PowerfulPurse extends Purse factory PurseImpl { | 228 interface PowerfulPurse extends Purse default PurseImpl { |
| 229 PowerfulPurse(); | 229 PowerfulPurse(); |
| 230 | 230 |
| 231 void init(Mint$Proxy mint, int balance); | 231 void init(Mint$Proxy mint, int balance); |
| 232 // Return an int so we can wait for it to complete. Shame we can't | 232 // Return an int so we can wait for it to complete. Shame we can't |
| 233 // have a Promise<void>. | 233 // have a Promise<void>. |
| 234 int grab(int amount); | 234 int grab(int amount); |
| 235 Purse weak(); | 235 Purse weak(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 interface Mint factory MintImpl { | 238 interface Mint default MintImpl { |
| 239 Mint(); | 239 Mint(); |
| 240 | 240 |
| 241 Purse$Proxy createPurse(int balance); | 241 Purse$Proxy createPurse(int balance); |
| 242 Promise<PowerfulPurse$Proxy> promote(Purse$Proxy purse); | 242 Promise<PowerfulPurse$Proxy> promote(Purse$Proxy purse); |
| 243 } | 243 } |
| 244 | 244 |
| 245 // Because promises can't be used as keys in maps until they have | 245 // Because promises can't be used as keys in maps until they have |
| 246 // completed, provide a wrapper. Note that if any key promise fails to | 246 // completed, provide a wrapper. Note that if any key promise fails to |
| 247 // resolve, then get()'s return may also fail to resolve. Right now, a | 247 // resolve, then get()'s return may also fail to resolve. Right now, a |
| 248 // Proxy can also be used since it has (kludgily) been made to inherit | 248 // 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... |
| 499 expect.succeeded(); | 499 expect.succeeded(); |
| 500 print("##DONE##"); | 500 print("##DONE##"); |
| 501 }); | 501 }); |
| 502 } | 502 } |
| 503 | 503 |
| 504 } | 504 } |
| 505 | 505 |
| 506 main() { | 506 main() { |
| 507 runTests([MintMakerFullyIsolatedTest.testMain]); | 507 runTests([MintMakerFullyIsolatedTest.testMain]); |
| 508 } | 508 } |
| OLD | NEW |