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

Side by Side Diff: tests/standalone/src/TimerCancel1Test.dart

Issue 9254026: Split dart:builtin into dart:builtin and dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment and add binaries. Created 8 years, 11 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
« no previous file with comments | « tests/standalone/src/TestRunnerTest.dart ('k') | tests/standalone/src/TimerCancel2Test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #import("dart:io");
6
5 // Test that a timeout handler can cancel another. 7 // Test that a timeout handler can cancel another.
6 class TimerCancel1Test { 8 class TimerCancel1Test {
7 static void testOtherCancel() { 9 static void testOtherCancel() {
8 var canceleeTimer; 10 var canceleeTimer;
9 var cancelerTimer; 11 var cancelerTimer;
10 12
11 void timeoutHandlerUnreachable(Timer timer) { 13 void timeoutHandlerUnreachable(Timer timer) {
12 Expect.fail("A canceled timeout handler should be unreachable."); 14 Expect.fail("A canceled timeout handler should be unreachable.");
13 } 15 }
14 16
15 void cancelHandler(Timer timer) { 17 void cancelHandler(Timer timer) {
16 canceleeTimer.cancel(); 18 canceleeTimer.cancel();
17 } 19 }
18 20
19 cancelerTimer = new Timer(cancelHandler, 1); 21 cancelerTimer = new Timer(cancelHandler, 1);
20 canceleeTimer = new Timer(timeoutHandlerUnreachable, 1000); 22 canceleeTimer = new Timer(timeoutHandlerUnreachable, 1000);
21 } 23 }
22 24
23 static void testMain() { 25 static void testMain() {
24 testOtherCancel(); 26 testOtherCancel();
25 } 27 }
26 } 28 }
27 29
28 main() { 30 main() {
29 TimerCancel1Test.testMain(); 31 TimerCancel1Test.testMain();
30 } 32 }
OLDNEW
« no previous file with comments | « tests/standalone/src/TestRunnerTest.dart ('k') | tests/standalone/src/TimerCancel2Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698