Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #library("mintmakerrpctest"); | 5 #library("mintmakerrpctest"); |
| 6 #import("dart:isolate"); | 6 #import("dart:isolate"); |
| 7 #import("../../../../proxy/proxy.dart"); | 7 #import("../../../../proxy/proxy.dart"); |
| 8 | 8 |
| 9 /*** | 9 /*** |
| 10 * Background: | 10 * Background: |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 } | 166 } |
| 167 | 167 |
| 168 class MintIsolate extends Isolate { | 168 class MintIsolate extends Isolate { |
| 169 MintIsolate() : super.light() {} | 169 MintIsolate() : super.light() {} |
| 170 | 170 |
| 171 MintProxy open() { | 171 MintProxy open() { |
| 172 return new MintProxy(spawn()); | 172 return new MintProxy(spawn()); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void main() { | 175 void main() { |
| 176 ReceivePort receivePort = port; | 176 // Note: 'super.' is needed here because the isolate library also defines a |
| 177 // top-level port, and that port is resolved first. | |
|
Siggi Cherem (dart-lang)
2012/04/20 00:58:23
... not sure why this wasn't failing before.
| |
| 178 ReceivePort receivePort = super.port; | |
| 177 new MintReceiver(receivePort); | 179 new MintReceiver(receivePort); |
| 178 } | 180 } |
| 179 } | 181 } |
| 180 | 182 |
| 181 class MintTest { | 183 class MintTest { |
| 182 static void testMain() { | 184 static void testMain() { |
| 183 print("starting test"); | 185 print("starting test"); |
| 184 MintProxy mint = new MintIsolate().open(); | 186 MintProxy mint = new MintIsolate().open(); |
| 185 mint.createPurse(100).then((PurseProxy purse1) { | 187 mint.createPurse(100).then((PurseProxy purse1) { |
| 186 purse1.queryBalance().then((int balance) { | 188 purse1.queryBalance().then((int balance) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 }); | 238 }); |
| 237 }); | 239 }); |
| 238 }); | 240 }); |
| 239 print ("exit main"); | 241 print ("exit main"); |
| 240 } | 242 } |
| 241 } | 243 } |
| 242 | 244 |
| 243 main() { | 245 main() { |
| 244 MintTest.testMain(); | 246 MintTest.testMain(); |
| 245 } | 247 } |
| OLD | NEW |