mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Tests for requestAnimationFrame and cancelAnimationFrame
This commit is contained in:
parent
8f53c564da
commit
1c60f90ee5
@ -62,4 +62,30 @@
|
||||
});
|
||||
});
|
||||
|
||||
// ----------
|
||||
asyncTest("requestAnimationFrame", function() {
|
||||
var timeWatcher = Util.timeWatcher();
|
||||
|
||||
OpenSeadragon.requestAnimationFrame(function() {
|
||||
ok(true, 'frame fired');
|
||||
timeWatcher.done();
|
||||
});
|
||||
});
|
||||
|
||||
// ----------
|
||||
asyncTest("cancelAnimationFrame", function() {
|
||||
var frameFired = false;
|
||||
|
||||
setTimeout(function() {
|
||||
strictEqual(frameFired, false, 'the frame never fired');
|
||||
start();
|
||||
}, 150);
|
||||
|
||||
var frameId = OpenSeadragon.requestAnimationFrame(function() {
|
||||
frameFired = true;
|
||||
});
|
||||
|
||||
OpenSeadragon.cancelAnimationFrame(frameId);
|
||||
});
|
||||
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user