Bug 1181765. Remove uses of mozRequestAnimationFrame from layout tests. r=bkelly

This commit is contained in:
Boris Zbarsky 2015-07-14 15:28:58 -04:00
Родитель f9793d505e
Коммит 3dc492a257
9 изменённых файлов: 21 добавлений и 31 удалений

Просмотреть файл

@ -11,7 +11,7 @@
if (report) {
opener.postMessage("callbackHappened", "*");
}
window.mozRequestAnimationFrame(g);
window.requestAnimationFrame(g);
}
g();

Просмотреть файл

@ -21,24 +21,22 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=569520
SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged");
var startNow = Date.now();
var start = window.mozAnimationStartTime;
var start = window.performance.now();
var firstListenerArg;
var secondListenerArg;
var thirdListenerTime;
// callback arg is wallclock from mozRequestAnimationFrame
// callback arg is in the same timeline as performance.now()
function thirdListener(t) {
thirdListenerTime = t;
// 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(secondListenerArg >= firstListenerArg, // callback args from consecutive unprefixed requestAnimationFrame
ok(secondListenerArg >= firstListenerArg, // callback args from consecutive requestAnimationFrame
"Second listener should fire after first listener");
ok(thirdListenerTime >= start, "Third listener should fire after start");
ok(thirdListenerTime >= secondListenerArg,
"Third listener should fire after second listener");
ok(firstListenerArg >= start, "First listener should fire after start");
SimpleTest.finish();
}
@ -46,7 +44,7 @@ function thirdListener(t) {
// callback arg is from requestAnimationFrame and comparable to performance.now()
function secondListener(t) {
secondListenerArg = t;
mozRequestAnimationFrame(thirdListener);
requestAnimationFrame(thirdListener);
}
function firstListener(t) {

Просмотреть файл

@ -21,24 +21,22 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=569520
SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged");
var startNow = Date.now();
var start = window.mozAnimationStartTime;
var start = window.performance.now();
var firstListenerArg;
var secondListenerArg;
var thirdListenerTime;
// callback arg is wallclock from mozRequestAnimationFrame
// callback arg is in the same timeline as performance.now()
function thirdListener(t) {
thirdListenerTime = t;
// 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(secondListenerArg >= firstListenerArg, // callback args from consecutive unprefixed requestAnimationFrame
ok(secondListenerArg >= firstListenerArg, // callback args from consecutive requestAnimationFrame
"Second listener should fire after first listener");
ok(thirdListenerTime >= start, "Third listener should fire after start");
ok(thirdListenerTime >= secondListenerArg,
"Third listener should fire after second listener");
ok(firstListenerArg >= start, "First listener should fire after start");
SimpleTest.finish();
}
@ -46,7 +44,7 @@ function thirdListener(t) {
// callback arg is from requestAnimationFrame and comparable to performance.now()
function secondListener(t) {
secondListenerArg = t;
mozRequestAnimationFrame(thirdListener);
requestAnimationFrame(thirdListener);
}
function firstListener(t) {

Просмотреть файл

@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=607529
SimpleTest.waitForExplicitFinish();
/* General idea: Open a new window (needed because we don't bfcache
subframes) that uses mozRequestAnimationFrame, navigate it, navigate it
subframes) that uses requestAnimationFrame, navigate it, navigate it
back, and verify that the animations are still running. */
var doneOneLoad = false;

Просмотреть файл

@ -42,7 +42,7 @@ function onScroll() {
function doTest() {
window.getSelection().collapse(inner.firstChild, 0);
window.mozRequestAnimationFrame(onFrame);
window.requestAnimationFrame(onFrame);
d.onscroll = onScroll;
sendKey("DOWN");
}
@ -50,7 +50,7 @@ function doTest() {
function prepareTest() {
// Start the test after we've gotten at least one rAF callback, to make sure
// that rAF is no longer throttled. (See bug 1145439.)
window.mozRequestAnimationFrame(function() {
window.requestAnimationFrame(function() {
SpecialPowers.pushPrefEnv({"set":[[smoothScrollPref, false]]}, doTest);
});
}

Просмотреть файл

@ -48,7 +48,7 @@ function runTest() {
// Delay until next repaint in case stuff is asynchronous. Also
// take a trip through the event loop.
setTimeout(function() {
window.mozRequestAnimationFrame(function() {
window.requestAnimationFrame(function() {
is(sel.anchorNode, target.firstChild, "Should have selected 'target' text node");
is(sel.anchorOffset, 1, "Selection should have moved left one character");
// We should not have needed to scroll the caret into view

Просмотреть файл

@ -5,8 +5,6 @@ var property = "left";
var rfa = null;
if (window.requestAnimationFrame) {
rfa = requestAnimationFrame;
} else if (window.mozRequestAnimationFrame) {
rfa = mozRequestAnimationFrame;
} else if (window.webkitRequestAnimationFrame) {
rfa = webkitRequestAnimationFrame;
} else if (window.msRequestAnimationFrame) {

Просмотреть файл

@ -1,8 +1,6 @@
var rfa = null;
if (window.requestAnimationFrame) {
rfa = requestAnimationFrame;
} else if (window.mozRequestAnimationFrame) {
rfa = mozRequestAnimationFrame;
} else if (window.webkitRequestAnimationFrame) {
rfa = webkitRequestAnimationFrame;
} else if (window.msRequestAnimationFrame) {

Просмотреть файл

@ -5,8 +5,6 @@ var property = "top";
var rfa = null;
if (window.requestAnimationFrame) {
rfa = requestAnimationFrame;
} else if (window.mozRequestAnimationFrame) {
rfa = mozRequestAnimationFrame;
} else if (window.webkitRequestAnimationFrame) {
rfa = webkitRequestAnimationFrame;
} else if (window.msRequestAnimationFrame) {