Chromium Code Reviews| 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('timer_repeat_test'); | 5 #library('timer_repeat_test'); |
| 6 | 6 |
| 7 #import("dart:isolate"); | 7 #import("dart:isolate"); |
| 8 #import('../../pkg/unittest/unittest.dart'); | 8 #import('../../pkg/unittest/unittest.dart'); |
| 9 | 9 |
| 10 const int TIMEOUT = 500; | 10 const int TIMEOUT = 500; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 expect(iteration, ITERATIONS); | 23 expect(iteration, ITERATIONS); |
| 24 timer.cancel(); | 24 timer.cancel(); |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 | 27 |
| 28 main() { | 28 main() { |
| 29 test("timer_repeat", () { | 29 test("timer_repeat", () { |
| 30 iteration = 0; | 30 iteration = 0; |
| 31 startTime = new Date.now().millisecondsSinceEpoch; | 31 startTime = new Date.now().millisecondsSinceEpoch; |
| 32 timer = new Timer.repeating(TIMEOUT, | 32 timer = new Timer.repeating(TIMEOUT, |
| 33 expectAsync1(timeoutHandler, count: ITERATIONS)); | 33 expectAsync1(timeoutHandler, ITERATIONS)); |
|
Lasse Reichstein Nielsen
2012/10/09 12:35:00
Is the last parameter *ever* omitted? Otherwise, i
regis
2012/10/11 01:33:56
Yes, it is omitted a lot. I made count a named opt
| |
| 34 }); | 34 }); |
| 35 } | 35 } |
| OLD | NEW |