OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 #library('RequestAnimationFrameTest'); |
| 6 #import('../../../../lib/unittest/unittest.dart'); |
| 7 #import('../../../../lib/unittest/html_config.dart'); |
| 8 #import('dart:html'); |
| 9 |
| 10 main() { |
| 11 useHtmlConfiguration(); |
| 12 |
| 13 asyncTest('oneShot', 1, () { |
| 14 var frame = window.requestAnimationFrame( |
| 15 (timestamp) { callbackDone(); }); |
| 16 }); |
| 17 |
| 18 asyncTest('twoShot', 1, () { |
| 19 var frame = window.requestAnimationFrame( |
| 20 (timestamp1) { |
| 21 window.requestAnimationFrame( |
| 22 (timestamp2) { |
| 23 Expect.isTrue(timestamp2 > timestamp1, 'timestamps ordered'); |
| 24 callbackDone(); |
| 25 }); |
| 26 }); |
| 27 }); |
| 28 } |
OLD | NEW |