2010-08-11 14:05:28 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=569520
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 569520</title>
|
|
|
|
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=569520">Mozilla Bug 569520</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
/** Test for Bug 569520 **/
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
var startNow = Date.now();
|
|
|
|
var start = window.mozAnimationStartTime;
|
|
|
|
var firstListenerTime;
|
|
|
|
var secondListenerTime;
|
|
|
|
|
|
|
|
function secondListener(ev) {
|
|
|
|
secondListenerTime = ev.timeStamp;
|
|
|
|
window.removeEventListener("MozBeforePaint", secondListener, false);
|
|
|
|
|
|
|
|
// They really shouldn't be more than 100ms apart, but we can get weird
|
|
|
|
// effects on slow machines. 5 minutes is our test timeout, though.
|
|
|
|
ok(Math.abs(startNow - start) <= 5 * 60 * 1000, "Bogus animation start time");
|
|
|
|
ok(firstListenerTime >= start, "First listener should fire after start");
|
2010-08-24 23:52:07 -07:00
|
|
|
// FIXME: The timer filtering code makes the refresh driver call back in 0ms
|
|
|
|
// sometimes!
|
|
|
|
ok(secondListenerTime >= firstListenerTime,
|
2010-08-11 14:05:28 -07:00
|
|
|
"Second listener should fire after first listener");
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
function firstListener(ev) {
|
|
|
|
firstListenerTime = ev.timeStamp;
|
|
|
|
window.removeEventListener("MozBeforePaint", firstListener, false);
|
|
|
|
window.addEventListener("MozBeforePaint", secondListener, false);
|
|
|
|
mozRequestAnimationFrame();
|
|
|
|
}
|
|
|
|
|
|
|
|
addLoadEvent(function() {
|
|
|
|
setTimeout(function() {
|
|
|
|
window.addEventListener("MozBeforePaint", firstListener, false);
|
|
|
|
mozRequestAnimationFrame();
|
|
|
|
}, 100);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|