Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1442)

Unified Diff: tests/isolate/src/RequestReplyTest.dart

Issue 10153005: unittest step 3 and 4: remove TestFramework.dart, make test.dart use (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/isolate/src/PortTest.dart ('k') | tests/isolate/src/SpawnTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]);
-}
« no previous file with comments | « tests/isolate/src/PortTest.dart ('k') | tests/isolate/src/SpawnTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698