Bug 1341985 - Use registerCleanupFunction to restore to normal refresh mode. r?heycam
Otherwise, the refresh driver left under test mode when a javascript error
occurs in the middle of tests.
MozReview-Commit-ID: J7oUuuYhTZ1
--- a/layout/style/test/test_animations.html
+++ b/layout/style/test/test_animations.html
@@ -226,16 +226,20 @@ var div, cs;
var originalNewDiv = window.new_div;
window.new_div = function(style) {
[ div, cs ] = originalNewDiv(style);
};
// take over the refresh driver right from the start.
advance_clock(0);
+SimpleTest.registerCleanupFunction(() => {
+ SpecialPowers.DOMWindowUtils.restoreNormalRefresh();
+});
+
/*
* css3-animations: 2. Animations
* http://dev.w3.org/csswg/css3-animations/#animations
*/
// Test that animations don't affect the computed value before the
// start of the animation or after its end. Test without
// animation-fill-mode, but then repeat the test with all the values of
@@ -2090,14 +2094,12 @@ is(cs.getPropertyValue("left"), "5px", "
div.style.animation = "unset";
div.style.animation = "none 1s linear";
is(cs.getPropertyValue("left"), "0px", "animation name 'none' as identifier is ignored");
div.style.animation = "unset";
div.style.animation = "\"none\" 1s linear";
is(cs.getPropertyValue("left"), "7px", "animation name 'none' as string is accepted");
done_div();
-SpecialPowers.DOMWindowUtils.restoreNormalRefresh();
-
</script>
</pre>
</body>
</html>