Bug 1464396 - Part 3: Add whether the created time of animation unchanged even if change node. r=pbro

MozReview-Commit-ID: BT4DUJUFkdp

--HG--
extra : rebase_source : 5a24f489b80e2a0c0456812a94d133e6ba2246a0
This commit is contained in:
Daisuke Akatsuka 2018-05-29 10:09:44 +09:00
parent 65c21a4698
commit a8a04b5c6a
3 changed files with 38 additions and 3 deletions

View File

@ -43,6 +43,7 @@ support-files =
[browser_animation_keyframes-progress-bar_after-resuming.js]
[browser_animation_logic_auto-stop.js]
[browser_animation_logic_avoid-updating-during-hiding.js]
[browser_animation_logic_created-time.js]
[browser_animation_logic_mutations.js]
[browser_animation_logic_mutations_fast.js]
[browser_animation_pause-resume-button.js]

View File

@ -0,0 +1,33 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test whether the created time of animation unchanged even if change node.
add_task(async function() {
await addTab(URL_ROOT + "doc_custom_playback_rate.html");
const { animationInspector, inspector } = await openAnimationInspector();
info("Check both the created time of animation are same");
const baseCreatedTime = animationInspector.state.animations[0].state.createdTime;
is(animationInspector.state.animations[1].state.createdTime, baseCreatedTime,
"Both created time of animations should be same");
info("Check created time after selecting '.div1'");
await selectNodeAndWaitForAnimations(".div1", inspector);
is(animationInspector.state.animations[0].state.createdTime, baseCreatedTime,
"The created time of animation on element of .div1 should unchanged");
info("Check created time after selecting '.div2'");
await selectNodeAndWaitForAnimations(".div2", inspector);
is(animationInspector.state.animations[0].state.createdTime, baseCreatedTime,
"The created time of animation on element of .div2 should unchanged");
info("Check created time after selecting 'body' again");
await selectNodeAndWaitForAnimations("body", inspector);
is(animationInspector.state.animations[0].state.createdTime, baseCreatedTime,
"The created time of animation[0] should unchanged");
is(animationInspector.state.animations[1].state.createdTime, baseCreatedTime,
"The created time of animation[1] should unchanged");
});

View File

@ -15,15 +15,16 @@
const duration = 100000;
function createAnimation() {
function createAnimation(cls) {
const div = document.createElement("div");
div.classList.add(cls);
document.body.appendChild(div);
const animation = div.animate([{ opacity: 0 }], duration);
animation.playbackRate = 1.5;
}
createAnimation();
createAnimation();
createAnimation("div1");
createAnimation("div2");
</script>
</body>
</html>