Bug 1456828 - Part 4: Add a test that whether the scroll amount change. r=gl

MozReview-Commit-ID: AKC950dTv1g

--HG--
extra : rebase_source : f5a5a9bf50cd9f8b3facaf54c6cdac191811e791
This commit is contained in:
Daisuke Akatsuka 2018-06-15 19:54:38 +09:00
Родитель a66d570b05
Коммит 067a51bced
2 изменённых файлов: 39 добавлений и 0 удалений

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

@ -48,6 +48,7 @@ skip-if = (verify && !debug)
[browser_animation_logic_created-time.js]
[browser_animation_logic_mutations.js]
[browser_animation_logic_mutations_fast.js]
[browser_animation_logic_scroll-amount.js]
[browser_animation_pause-resume-button.js]
[browser_animation_pause-resume-button_end-time.js]
[browser_animation_pause-resume-button_respectively.js]

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

@ -0,0 +1,38 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test whether the scroll amount of animation and animated property re-calculate after
// changing selected node.
add_task(async function() {
await addTab(URL_ROOT + "doc_simple_animation.html");
await removeAnimatedElementsExcept(
[".animated", ".multi", ".longhand", ".negative-delay"]);
const { animationInspector, inspector, panel } = await openAnimationInspector();
info("Set the scroll amount of animation and animated property to the bottom");
await clickOnAnimationByTargetSelector(animationInspector, panel, ".longhand");
const bottomAnimationEl =
panel.querySelector(".animation-item:last-child");
const bottomAnimatedPropertyEl =
panel.querySelector(".animated-property-item:last-child");
bottomAnimationEl.scrollIntoView(false);
bottomAnimatedPropertyEl.scrollIntoView(false);
info("Hold the scroll amount");
const animationInspectionPanel =
bottomAnimationEl.closest(".progress-inspection-panel");
const animatedPropertyInspectionPanel =
bottomAnimatedPropertyEl.closest(".progress-inspection-panel");
const initialScrollTopOfAnimation = animationInspectionPanel.scrollTop;
const initialScrollTopOfAnimatedProperty = animatedPropertyInspectionPanel.scrollTop;
info("Check whether the scroll amount re-calculate after changing the count of items");
await selectNodeAndWaitForAnimations(".negative-delay", inspector);
ok(initialScrollTopOfAnimation > animationInspectionPanel.scrollTop,
"Scroll amount for animation list should be less than previous state");
ok(initialScrollTopOfAnimatedProperty > animatedPropertyInspectionPanel.scrollTop,
"Scroll amount for animated property list should be less than previous state");
});