Chromium Code Reviews| 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.
|
| + }); |
| } |