| 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 #library("TestFramework"); | 5 #library("TestFramework"); |
| 6 #import("dart:coreimpl"); | 6 #import("dart:coreimpl"); |
| 7 | 7 |
| 8 | 8 |
| 9 typedef void AsynchronousTestFunction(TestExpectation check); | 9 typedef void AsynchronousTestFunction(TestExpectation check); |
| 10 | 10 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 } | 269 } |
| 270 } | 270 } |
| 271 | 271 |
| 272 void removeRunning() { | 272 void removeRunning() { |
| 273 if (--running == 0) { | 273 if (--running == 0) { |
| 274 keepalive.toSendPort().send(null, null); | 274 keepalive.toSendPort().send(null, null); |
| 275 keepalive = null; | 275 keepalive = null; |
| 276 } | 276 } |
| 277 } | 277 } |
| 278 | 278 |
| 279 // AsynchronousTestCase.run() calls variable test, not function performTest. |
| 280 void performTest() { |
| 281 Expect.fail('performTest called in AsynchronousTestCase'); |
| 282 } |
| 283 |
| 279 AsynchronousTestFunction test; | 284 AsynchronousTestFunction test; |
| 280 | 285 |
| 281 static int running = 0; | 286 static int running = 0; |
| 282 static ReceivePort keepalive = null; | 287 static ReceivePort keepalive = null; |
| 283 | 288 |
| 284 } | 289 } |
| 285 | 290 |
| 286 // TODO(mattsh) - remove this once we have migrated the rpc system | 291 // TODO(mattsh) - remove this once we have migrated the rpc system |
| 287 class TestPromise<T> extends PromiseImpl<T> { | 292 class TestPromise<T> extends PromiseImpl<T> { |
| 288 | 293 |
| 289 TestPromise(this.expect) : super(); | 294 TestPromise(this.expect) : super(); |
| 290 | 295 |
| 291 void addCompleteHandler(void completeHandler(T result)) { | 296 void addCompleteHandler(void completeHandler(T result)) { |
| 292 super.addCompleteHandler(expect.runs1((T result) { | 297 super.addCompleteHandler(expect.runs1((T result) { |
| 293 completeHandler(result); | 298 completeHandler(result); |
| 294 })); | 299 })); |
| 295 } | 300 } |
| 296 | 301 |
| 297 final TestExpectation expect; | 302 final TestExpectation expect; |
| 298 | 303 |
| 299 } | 304 } |
| OLD | NEW |