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

Unified Diff: tests/isolate/src/Isolate2NegativeTest.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/CrossIsolateMessageTest.dart ('k') | tests/isolate/src/Isolate3NegativeTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/src/Isolate2NegativeTest.dart
diff --git a/tests/isolate/src/Isolate2NegativeTest.dart b/tests/isolate/src/Isolate2NegativeTest.dart
index 9e0cc9748a28c4f58d8fa19e7e4da9da55c96df7..58ebd4a443945ba2a7e75647f610eca167657a13 100644
--- a/tests/isolate/src/Isolate2NegativeTest.dart
+++ b/tests/isolate/src/Isolate2NegativeTest.dart
@@ -7,7 +7,7 @@
#library('Isolate2NegativeTest');
#import('dart:isolate');
-#import('TestFramework.dart');
+#import('../../../lib/unittest/unittest.dart');
class Isolate2NegativeTest extends Isolate {
Isolate2NegativeTest() : super();
@@ -17,11 +17,10 @@ class Isolate2NegativeTest extends Isolate {
}
}
-void test(TestExpectation expect) {
- // We will never call 'expect.succeeded'. This test fails with a timeout.
- expect.completes(new Isolate2NegativeTest().spawn());
-}
-
main() {
- runTests([test]);
+ test("catch exception from other isolate", () {
+ // Calling 'then' ensures the test framework is aware that there is a
+ // pending callback, so it can fail quickly.
+ new Isolate2NegativeTest().spawn().then(expectAsync1((a) => null));
+ });
}
« no previous file with comments | « tests/isolate/src/CrossIsolateMessageTest.dart ('k') | tests/isolate/src/Isolate3NegativeTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698