Bug 1256503 - Part 2: Increase some test animation durations to be at least 100 seconds. r?dholbert
In some of these cases, this increase isn't strictly necessary, because we only
check state immediately after creating the animation, before it could have
completed (regardless of its duration). Still: we should consistently use long
durations for any animations that aren't expected to complete during the test
run, because short durations might accidentally get copypasted into new tests
where they might cause intermittent failures.
MozReview-Commit-ID: 8wSRqHMI12L
--- a/dom/animation/test/chrome/test_animate_xrays.html
+++ b/dom/animation/test/chrome/test_animate_xrays.html
@@ -14,17 +14,17 @@
<script>
'use strict';
var win = document.getElementById('iframe').contentWindow;
async_test(function(t) {
window.addEventListener('load', t.step_func(function() {
var target = win.document.getElementById('target');
- var anim = target.animate({ opacity: [ 0, 1 ] }, 2 * MS_PER_SEC);
+ var anim = target.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC);
// In the x-ray case, the frames object will be given an opaque wrapper
// so it won't be possible to fetch any frames from it.
assert_equals(anim.effect.getFrames().length, 0);
t.done();
}));
}, 'Calling animate() across x-rays');
</script>
--- a/dom/animation/test/chrome/test_animation_observers.html
+++ b/dom/animation/test/chrome/test_animation_observers.html
@@ -1520,37 +1520,37 @@ addAsyncAnimTest("tree_ordering", { obse
childA.remove();
childB.remove();
extraStyle.remove();
});
[ div, pseudoTarget ].forEach(function(target) {
addAsyncAnimTest("change_duration_and_currenttime",
{ observe: div, subtree: true }, function*() {
- var anim = target.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC);
+ var anim = target.animate({ opacity: [ 0, 1 ] }, 200 * MS_PER_SEC);
yield await_frame();
assert_records([{ added: [anim], changed: [], removed: [] }],
"records after animation is added");
- anim.effect.timing.duration = 10 * MS_PER_SEC;
+ anim.effect.timing.duration = 100 * MS_PER_SEC;
yield await_frame();
assert_records([{ added: [], changed: [anim], removed: [] }],
"records after duration is changed");
- anim.effect.timing.duration = 10 * MS_PER_SEC;
+ anim.effect.timing.duration = 100 * MS_PER_SEC;
yield await_frame();
assert_records([], "records after assigning same value");
- anim.currentTime = 50 * MS_PER_SEC;
+ anim.currentTime = 500 * MS_PER_SEC;
yield await_frame();
assert_records([{ added: [], changed: [], removed: [anim] }],
"records after animation end");
- anim.effect.timing.duration = 100 * MS_PER_SEC;
+ anim.effect.timing.duration = 1000 * MS_PER_SEC;
yield await_frame();
assert_records([{ added: [anim], changed: [], removed: [] }],
"records after animation restarted");
anim.effect.timing.duration = "auto";
yield await_frame();
assert_records([{ added: [], changed: [], removed: [anim] }],
"records after duration set \"auto\"");
@@ -1592,17 +1592,18 @@ addAsyncAnimTest("change_enddelay_and_cu
anim.cancel();
yield await_frame();
});
addAsyncAnimTest("change_enddelay_and_currenttime",
{ observe: div, subtree: true }, function*() {
var anim = div.animate({ opacity: [ 0, 1 ] },
- { duration: 100, endDelay: -100 });
+ { duration: 100 * MS_PER_SEC,
+ endDelay: -100 * MS_PER_SEC });
yield await_frame();
assert_records([], "records after animation is added");
});
addAsyncAnimTest("change_iterations",
{ observe: div, subtree: true }, function*() {
var anim = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC);
--- a/dom/animation/test/chrome/test_animation_properties.html
+++ b/dom/animation/test/chrome/test_animation_properties.html
@@ -488,16 +488,16 @@ var gTests = [
values: [ value(0, '100px', 'replace', 'linear'),
value(1, '200px', 'replace') ] } ]
}
];
gTests.forEach(function(subtest) {
test(function(t) {
var div = addDiv(t);
- var animation = div.animate(subtest.frames, 1 * MS_PER_SEC);
+ var animation = div.animate(subtest.frames, 100 * MS_PER_SEC);
assert_properties_equal(animation.effect.getProperties(),
subtest.expected);
}, subtest.desc);
});
</script>
</body>
--- a/dom/animation/test/chrome/test_running_on_compositor.html
+++ b/dom/animation/test/chrome/test_running_on_compositor.html
@@ -282,24 +282,24 @@ promise_test(function(t) {
+ 'property is overridden in the CSS cascade, the animation should '
+ 'still report that it is running on the compositor');
}));
}, 'isRunningOnCompositor is true when a property that would otherwise block ' +
'running on the compositor is overridden in the CSS cascade');
promise_test(function(t) {
var div = addDiv(t);
- var animation = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC);
+ var animation = div.animate({ opacity: [ 0, 1 ] }, 200 * MS_PER_SEC);
return animation.ready.then(t.step_func(function() {
assert_equals(animation.isRunningOnCompositor, omtaEnabled,
'Animation reports that it is running on the compositor');
- animation.currentTime = 50 * MS_PER_SEC;
- animation.effect.timing.duration = 10 * MS_PER_SEC;
+ animation.currentTime = 150 * MS_PER_SEC;
+ animation.effect.timing.duration = 100 * MS_PER_SEC;
assert_equals(animation.isRunningOnCompositor, false,
'Animation reports that it is NOT running on the compositor'
+ ' when the animation is set a shorter duration than current time');
}));
}, 'animation is immediately removed from compositor' +
'when timing.duration is made shorter than the current time');