Bug 1387894 - Fix browser_animation_setCurrentTime.js for unconditional clamping r=birtles

This has to do with double imprecision. The test originally had toPrecision(6) to
account for this imprecision. It'd round up 499.9999 into 500. When we send
double(500) (which is an epsilon below 500) into ReduceTimePrecision we wind up
coming out with 499.98. By reducing our precision requirement in this test
we can handle that and round 499.98 back up to 500

Differential Revision: https://phabricator.services.mozilla.com/D38809

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Ritter 2019-07-30 15:12:08 +00:00
Родитель 210fb2ea26
Коммит 48c645ebf2
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -40,7 +40,7 @@ async function testSetCurrentTimes(walker, animations) {
const state = await players[i].getCurrentState();
is(state.playState, "paused", `Player ${i + 1} is paused`);
is(
parseInt(state.currentTime.toPrecision(6), 10),
parseInt(state.currentTime.toPrecision(4), 10),
500,
`Player ${i + 1} has the right currentTime`
);