From 5245b1205bfab0b0fae5b2e04058ba9bdce4a1a1 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Tue, 30 Jul 2019 13:19:05 +0000 Subject: [PATCH] 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 --- .../server/tests/browser/browser_animation_setCurrentTime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/server/tests/browser/browser_animation_setCurrentTime.js b/devtools/server/tests/browser/browser_animation_setCurrentTime.js index 8f23474741e1..887fb35c064b 100644 --- a/devtools/server/tests/browser/browser_animation_setCurrentTime.js +++ b/devtools/server/tests/browser/browser_animation_setCurrentTime.js @@ -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` );