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

Unified Diff: tests/isolate/timer_cancel1_test.dart

Issue 11028076: Fix timer tests: timer tests were not using expectAsync to wait for (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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/timer_cancel1_test.dart
diff --git a/tests/isolate/timer_cancel1_test.dart b/tests/isolate/timer_cancel1_test.dart
index 2b4273e311e5715f68e85c0b8f12e2ba634c7023..8a0e5f35c11ca449addc23198b87d6a2f17466de 100644
--- a/tests/isolate/timer_cancel1_test.dart
+++ b/tests/isolate/timer_cancel1_test.dart
@@ -5,30 +5,23 @@
#library('timer_cancel1_test');
#import("dart:isolate");
+#import('../../pkg/unittest/unittest.dart');
-// Test that a timeout handler can cancel another.
-class TimerCancel1Test {
- static void testOtherCancel() {
+main() {
+ // Test that a timeout handler can cancel another.
+ test("timer cancel1 test", () {
var canceleeTimer;
var cancelerTimer;
void timeoutHandlerUnreachable(Timer timer) {
- Expect.fail("A canceled timeout handler should be unreachable.");
+ fail("A canceled timeout handler should be unreachable.");
}
void cancelHandler(Timer timer) {
canceleeTimer.cancel();
}
- cancelerTimer = new Timer(1, cancelHandler);
- canceleeTimer = new Timer(1000, timeoutHandlerUnreachable);
- }
-
- static void testMain() {
- testOtherCancel();
- }
-}
-
-main() {
- TimerCancel1Test.testMain();
+ cancelerTimer = new Timer(1, expectAsync1(cancelHandler));
+ canceleeTimer = new Timer(1000, expectAsync1(timeoutHandlerUnreachable, count: 0));
Siggi Cherem (dart-lang) 2012/10/08 21:50:07 80 col
justinfagnani 2012/10/08 22:12:48 Done.
+ });
}

Powered by Google App Engine
This is Rietveld 408576698