Chromium Code Reviews| Index: tests/html/async_window_test.dart |
| =================================================================== |
| --- tests/html/async_window_test.dart (revision 7823) |
| +++ tests/html/async_window_test.dart (working copy) |
| @@ -5,24 +5,26 @@ |
| main() { |
| useHtmlConfiguration(); |
| - asyncTest('Window.setTimeout', 1, () { |
| - window.setTimeout(callbackDone, 10); |
| + test('Window.setTimeout', () { |
| + window.setTimeout(expectAsync0((){}), 10); |
| }); |
| - asyncTest('Window.setInterval', 1, () { |
| + test('Window.setInterval', () { |
| int counter = 0; |
| int id = null; |
| + var callback = expectAsync0((){}); |
| id = window.setInterval(() { |
|
Siggi Cherem (dart-lang)
2012/05/21 22:20:47
here also: count:3, get rid of 'callback'
gram
2012/05/22 17:36:36
Done.
|
| + guardAsync(() { |
| if (counter == 3) { |
| counter = 1024; |
| window.clearInterval(id); |
| // Wait some more time to be sure callback won't be invoked any more. |
| - window.setTimeout(callbackDone, 50); |
| + window.setTimeout(callback, 50); |
| return; |
| } |
| // As callback should have been cleared on 4th invocation, counter |
| // should never be greater than 3. |
| assert(counter < 3); |
| counter++; |
| - }, 10); |
| + });}, 10); |
|
Siggi Cherem (dart-lang)
2012/05/21 22:20:47
wrap after ;?
Siggi Cherem (dart-lang)
2012/05/21 22:20:47
wrap after ;?
gram
2012/05/22 17:36:36
Done.
gram
2012/05/22 17:36:36
Done.
|
| }); |
| } |