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

Side by Side Diff: tests/isolate/timer_cancel2_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library('timer_cancel2_test'); 5 #library('timer_cancel2_test');
6 6
7 #import("dart:isolate"); 7 #import("dart:isolate");
8 #import('../../pkg/unittest/unittest.dart');
8 9
9 // Test that a timeout handler can cancel itself. 10 main() {
10 class TimerCancel2Test { 11 // Test that a timeout handler can cancel itself.
11 static void testSelfCancel() { 12 test("timer cancel test 2", () {
12 var cancelTimer; 13 var cancelTimer;
13 14
14 void cancelHandler(Timer timer) { 15 void cancelHandler(Timer timer) {
15 cancelTimer.cancel(); 16 cancelTimer.cancel();
16 } 17 }
17 18
18 cancelTimer = new Timer.repeating(1, cancelHandler); 19 cancelTimer = new Timer.repeating(1, expectAsync1(cancelHandler));
19 } 20 });
20
21 static void testMain() {
22 testSelfCancel();
23 }
24 } 21 }
25
26 main() {
27 TimerCancel2Test.testMain();
28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698