diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /devtools/client/inspector/animation/test/browser_animation_logic_scroll-amount.js | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | devtools/client/inspector/animation/test/browser_animation_logic_scroll-amount.js | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/devtools/client/inspector/animation/test/browser_animation_logic_scroll-amount.js b/devtools/client/inspector/animation/test/browser_animation_logic_scroll-amount.js new file mode 100644 index 0000000000..11835cd880 --- /dev/null +++ b/devtools/client/inspector/animation/test/browser_animation_logic_scroll-amount.js @@ -0,0 +1,70 @@ +/* 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" + ); + const onDetailRendered = animationInspector.once( + "animation-keyframes-rendered" + ); + await clickOnAnimationByTargetSelector( + animationInspector, + panel, + ".longhand" + ); + await onDetailRendered; + + await waitUntil(() => panel.querySelectorAll(".animation-item").length === 5); + const bottomAnimationEl = await findAnimationItemByIndex(panel, 4); + 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 selectNode(".negative-delay", inspector); + await waitUntil( + () => + initialScrollTopOfAnimation > animationInspectionPanel.scrollTop && + initialScrollTopOfAnimatedProperty > + animatedPropertyInspectionPanel.scrollTop + ); + ok( + true, + "Scroll amount for animation list should be less than previous state" + ); + ok( + true, + "Scroll amount for animated property list should be less than previous state" + ); +}); |