| OLD | NEW |
| 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('multiple_timer_test'); | 5 #library('multiple_timer_test'); |
| 6 | 6 |
| 7 #import("dart:isolate"); | 7 #import("dart:isolate"); |
| 8 | 8 |
| 9 class MultipleTimerTest { | 9 class MultipleTimerTest { |
| 10 | 10 |
| 11 static final int TIMEOUT1 = 1000; | 11 static const int TIMEOUT1 = 1000; |
| 12 static final int TIMEOUT2 = 2000; | 12 static const int TIMEOUT2 = 2000; |
| 13 static final int TIMEOUT3 = 500; | 13 static const int TIMEOUT3 = 500; |
| 14 static final int TIMEOUT4 = 1500; | 14 static const int TIMEOUT4 = 1500; |
| 15 | 15 |
| 16 static void testMultipleTimer() { | 16 static void testMultipleTimer() { |
| 17 | 17 |
| 18 void timeoutHandler1(Timer timer) { | 18 void timeoutHandler1(Timer timer) { |
| 19 int endTime = (new Date.now()).millisecondsSinceEpoch; | 19 int endTime = (new Date.now()).millisecondsSinceEpoch; |
| 20 Expect.equals(true, (endTime - _startTime1) >= TIMEOUT1); | 20 Expect.equals(true, (endTime - _startTime1) >= TIMEOUT1); |
| 21 Expect.equals(true, _order[_message] == 0); | 21 Expect.equals(true, _order[_message] == 0); |
| 22 _message++; | 22 _message++; |
| 23 } | 23 } |
| 24 | 24 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 static int _startTime2; | 68 static int _startTime2; |
| 69 static int _startTime3; | 69 static int _startTime3; |
| 70 static int _startTime4; | 70 static int _startTime4; |
| 71 static List<int> _order; | 71 static List<int> _order; |
| 72 static int _message; | 72 static int _message; |
| 73 } | 73 } |
| 74 | 74 |
| 75 main() { | 75 main() { |
| 76 MultipleTimerTest.testMain(); | 76 MultipleTimerTest.testMain(); |
| 77 } | 77 } |
| OLD | NEW |