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

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: Mark some tests as flaky in FF 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
« no previous file with comments | « tests/isolate/spawn_function_test.dart ('k') | tests/isolate/timer_cancel2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..052d9fe0ac1622678299b2c03f09d3a714fb7406 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.");
+ void unreachable(Timer timer) {
+ fail("A canceled timeout handler should be unreachable.");
}
- void cancelHandler(Timer timer) {
+ void handler(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(handler));
+ canceleeTimer = new Timer(1000, expectAsync1(unreachable, count: 0));
+ });
}
« no previous file with comments | « tests/isolate/spawn_function_test.dart ('k') | tests/isolate/timer_cancel2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698