mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1145327 Part 2: Add test to ensure requestAnimationFrame callback timestamps always go forward in time. r=birtles,dholbert
This commit is contained in:
parent
2429563580
commit
fb9a78d6a7
@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Test RequestAnimationFrame Timestamps are monotonically increasing</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script>
|
||||
var lastRequestAnimationFrameTimestamp = 0;
|
||||
var requestAnimationFrameCount = 20;
|
||||
var currentCount = 0;
|
||||
|
||||
// Test that all timestamps are always increasing
|
||||
// and do not ever go backwards
|
||||
function rafCallback(aTimestamp) {
|
||||
SimpleTest.ok(aTimestamp > lastRequestAnimationFrameTimestamp,
|
||||
"New RequestAnimationFrame timestamp should be later than the previous RequestAnimationFrame timestamp");
|
||||
lastRequestAnimationFrameTimestamp = aTimestamp;
|
||||
if (currentCount == requestAnimationFrameCount) {
|
||||
SimpleTest.finish();
|
||||
} else {
|
||||
currentCount++;
|
||||
window.requestAnimationFrame(rafCallback);
|
||||
}
|
||||
}
|
||||
|
||||
window.requestAnimationFrame(rafCallback);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
</script>
|
@ -3,6 +3,7 @@ support-files =
|
||||
testcommon.js
|
||||
|
||||
[animation-timeline/test_animation-timeline.html]
|
||||
[animation-timeline/test_request_animation_frame.html]
|
||||
skip-if = buildapp == 'mulet'
|
||||
[css-animations/test_animations-dynamic-changes.html]
|
||||
[css-animations/test_animation-effect-name.html]
|
||||
|
Loading…
Reference in New Issue
Block a user