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

Unified Diff: tests/isolate/src/StaticStateTest.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/StaticStateTest.dart
diff --git a/tests/isolate/src/StaticStateTest.dart b/tests/isolate/src/StaticStateTest.dart
index c993df938d3dc9cb28de58ad4d08cbe6e4ef7104..d18debc807c2659598246bbddc6dd7ee214fe425 100644
--- a/tests/isolate/src/StaticStateTest.dart
+++ b/tests/isolate/src/StaticStateTest.dart
@@ -4,7 +4,7 @@
#library("StaticStateTest");
#import("dart:isolate");
-#import("TestFramework.dart");
+#import('../../../lib/unittest/unittest.dart');
class TestIsolate extends Isolate {
@@ -26,26 +26,23 @@ class TestIsolate extends Isolate {
}
-void test(TestExpectation expect) {
- Expect.equals(null, TestIsolate.state);
- TestIsolate.state = "foo";
- Expect.equals("foo", TestIsolate.state);
-
- expect.completes(new TestIsolate().spawn()).then((SendPort remote) {
- remote.call("bar").then(expect.runs1((reply) {
- Expect.equals("foo", TestIsolate.state);
- Expect.equals(null, reply);
-
- TestIsolate.state = "baz";
- remote.call("exit").then(expect.runs1((reply) {
- Expect.equals("baz", TestIsolate.state);
- Expect.equals("bar", reply);
- expect.succeeded();
+void main() {
+ test("static state is not shared between isolates", () {
+ Expect.equals(null, TestIsolate.state);
+ TestIsolate.state = "foo";
+ Expect.equals("foo", TestIsolate.state);
+
+ new TestIsolate().spawn().then(later1((SendPort remote) {
+ remote.call("bar").then(later1((reply) {
+ Expect.equals("foo", TestIsolate.state);
+ Expect.equals(null, reply);
+
+ TestIsolate.state = "baz";
+ remote.call("exit").then(later1((reply) {
+ Expect.equals("baz", TestIsolate.state);
+ Expect.equals("bar", reply);
+ }));
}));
}));
});
}
-
-void main() {
- runTests([test]);
-}

Powered by Google App Engine
This is Rietveld 408576698