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

Unified Diff: tests/isolate/src/NestedSpawn2Test.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
Index: tests/isolate/src/NestedSpawn2Test.dart
diff --git a/tests/isolate/src/NestedSpawn2Test.dart b/tests/isolate/src/NestedSpawn2Test.dart
index 38e525c94a80c66e4e8afd45b109316ce7f3f718..90d67acff06168d529a23cfba687167a9610373e 100644
--- a/tests/isolate/src/NestedSpawn2Test.dart
+++ b/tests/isolate/src/NestedSpawn2Test.dart
@@ -8,7 +8,7 @@
#library('NestedSpawn2Test');
#import("dart:isolate");
-#import('TestFramework.dart');
+#import('../../../lib/unittest/unittest.dart');
class IsolateA extends Isolate {
IsolateA() : super.heavy();
@@ -63,24 +63,21 @@ class IsolateB extends Isolate {
}
}
-test(TestExpectation expect) {
- expect.completes(new IsolateA().spawn()).then((SendPort port) {
- _call(port, "launch nested!", expect.runs2((msg, replyTo) {
- Expect.equals("0", msg[0]);
- _call(replyTo, msg1, expect.runs2((msg, replyTo) {
- Expect.equals("2", msg[0]);
- _call(replyTo, msg3, expect.runs2((msg, replyTo) {
- Expect.equals("4", msg[0]);
- _call(replyTo, msg5, expect.runs2((msg, replyTo) {
- Expect.equals("6", msg[0]);
- expect.succeeded();
+main() {
+ test("spawned isolate can spawn other isolates", () {
+ new IsolateA().spawn().then(later1((SendPort port) {
+ _call(port, "launch nested!", later2((msg, replyTo) {
+ Expect.equals("0", msg[0]);
+ _call(replyTo, msg1, later2((msg, replyTo) {
+ Expect.equals("2", msg[0]);
+ _call(replyTo, msg3, later2((msg, replyTo) {
+ Expect.equals("4", msg[0]);
+ _call(replyTo, msg5, later2((msg, replyTo) {
+ Expect.equals("6", msg[0]);
+ }));
}));
}));
}));
}));
});
}
-
-main() {
- runTests([test]);
-}

Powered by Google App Engine
This is Rietveld 408576698