| Index: tests/isolate/src/RequestReplyTest.dart
|
| diff --git a/tests/isolate/src/RequestReplyTest.dart b/tests/isolate/src/RequestReplyTest.dart
|
| index 5037f6a0f16aa317a9d7662e0de46cd990693742..6e42d81b7b13205f7b7a9dcd223d6787d145ffe8 100644
|
| --- a/tests/isolate/src/RequestReplyTest.dart
|
| +++ b/tests/isolate/src/RequestReplyTest.dart
|
| @@ -3,8 +3,9 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| #library("RequestReplyTest");
|
| +
|
| #import("dart:isolate");
|
| -#import("TestFramework.dart");
|
| +#import('../../../lib/unittest/unittest.dart');
|
|
|
| class TestIsolate extends Isolate {
|
|
|
| @@ -19,27 +20,23 @@ class TestIsolate extends Isolate {
|
|
|
| }
|
|
|
| -void testCall(TestExpectation expect) {
|
| - expect.completes(new TestIsolate().spawn()).then((SendPort port) {
|
| - port.call(42).then(expect.runs1((message) {
|
| - Expect.equals(42 + 87, message);
|
| - expect.succeeded();
|
| +void main() {
|
| + test("call", () {
|
| + new TestIsolate().spawn().then(expectAsync1((SendPort port) {
|
| + port.call(42).then(expectAsync1((message) {
|
| + Expect.equals(42 + 87, message);
|
| + }));
|
| }));
|
| });
|
| -}
|
|
|
| -void testSend(TestExpectation expect) {
|
| - expect.completes(new TestIsolate().spawn()).then((SendPort port) {
|
| - ReceivePort reply = new ReceivePort();
|
| - port.send(99, reply.toSendPort());
|
| - reply.receive(expect.runs2((message, replyTo) {
|
| - Expect.equals(99 + 87, message);
|
| - reply.close();
|
| - expect.succeeded();
|
| + test("send", () {
|
| + new TestIsolate().spawn().then(expectAsync1((SendPort port) {
|
| + ReceivePort reply = new ReceivePort();
|
| + port.send(99, reply.toSendPort());
|
| + reply.receive(expectAsync2((message, replyTo) {
|
| + Expect.equals(99 + 87, message);
|
| + reply.close();
|
| + }));
|
| }));
|
| });
|
| }
|
| -
|
| -void main() {
|
| - runTests([testCall, testSend]);
|
| -}
|
|
|