| Index: tests/isolate/src/RequestReplyTest.dart
|
| diff --git a/tests/isolate/src/RequestReplyTest.dart b/tests/isolate/src/RequestReplyTest.dart
|
| index 6e42d81b7b13205f7b7a9dcd223d6787d145ffe8..5037f6a0f16aa317a9d7662e0de46cd990693742 100644
|
| --- a/tests/isolate/src/RequestReplyTest.dart
|
| +++ b/tests/isolate/src/RequestReplyTest.dart
|
| @@ -3,9 +3,8 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| #library("RequestReplyTest");
|
| -
|
| #import("dart:isolate");
|
| -#import('../../../lib/unittest/unittest.dart');
|
| +#import("TestFramework.dart");
|
|
|
| class TestIsolate extends Isolate {
|
|
|
| @@ -20,23 +19,27 @@ class TestIsolate extends Isolate {
|
|
|
| }
|
|
|
| -void main() {
|
| - test("call", () {
|
| - new TestIsolate().spawn().then(expectAsync1((SendPort port) {
|
| - port.call(42).then(expectAsync1((message) {
|
| - Expect.equals(42 + 87, message);
|
| - }));
|
| +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();
|
| }));
|
| });
|
| +}
|
|
|
| - 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 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();
|
| }));
|
| });
|
| }
|
| +
|
| +void main() {
|
| + runTests([testCall, testSend]);
|
| +}
|
|
|