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

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

Issue 10226008: Revert "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/MintMakerTest.dart ('k') | tests/isolate/src/MixedTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/src/Mixed2Test.dart
diff --git a/tests/isolate/src/Mixed2Test.dart b/tests/isolate/src/Mixed2Test.dart
index 4615290b8a8e84bc6fd96c47d92e131656f91d5e..be4871afb717e61aacb72b31cc778a56c27516d0 100644
--- a/tests/isolate/src/Mixed2Test.dart
+++ b/tests/isolate/src/Mixed2Test.dart
@@ -6,7 +6,7 @@
#library('Mixed2Test');
#import("dart:isolate");
-#import('../../../lib/unittest/unittest.dart');
+#import('TestFramework.dart');
// We want to send a message from the main-isolate to a chain of different
// isolates and then get a reply back.
@@ -107,27 +107,29 @@ class HeavyIsolate3 extends Isolate {
}
}
-
-main() {
- test("heavy and light isolates can be mixed", () {
- Future<SendPort> heavy1 = new HeavyIsolate1().spawn();
- Future<SendPort> heavy2 = new HeavyIsolate2().spawn();
- Future<SendPort> heavy3 = new HeavyIsolate3().spawn();
-
- heavy2.then(expectAsync1((SendPort heavy2Port) {
- heavy3.then(expectAsync1((SendPort heavy3Port) {
- heavy2Port.call(heavy3Port).then(expectAsync1((h2l1Port) {
- heavy1.then(expectAsync1((SendPort heavy1Port) {
- heavy1Port.send(h2l1Port, null);
- // ---------------
- // Setup complete.
- // Start the chain-message.
- heavy1Port.call(1).then(expectAsync1((result) {
- Expect.equals(6531, result);
- }));
+void test(TestExpectation expect) {
+ Future<SendPort> heavy1 = expect.completes(new HeavyIsolate1().spawn());
+ Future<SendPort> heavy2 = expect.completes(new HeavyIsolate2().spawn());
+ Future<SendPort> heavy3 = expect.completes(new HeavyIsolate3().spawn());
+
+ heavy2.then(expect.runs1((SendPort heavy2Port) {
+ heavy3.then(expect.runs1((SendPort heavy3Port) {
+ heavy2Port.call(heavy3Port).then(expect.runs1((h2l1Port) {
+ heavy1.then(expect.runs1((SendPort heavy1Port) {
+ heavy1Port.send(h2l1Port, null);
+ // ---------------
+ // Setup complete.
+ // Start the chain-message.
+ heavy1Port.call(1).then(expect.runs1((result) {
+ Expect.equals(6531, result);
+ expect.succeeded();
}));
}));
}));
}));
- });
+ }));
+}
+
+main() {
+ runTests([test]);
}
« no previous file with comments | « tests/isolate/src/MintMakerTest.dart ('k') | tests/isolate/src/MixedTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698