diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /devtools/client/inspector/animation/test/browser_animation_animated-property-list_unchanged-items.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | devtools/client/inspector/animation/test/browser_animation_animated-property-list_unchanged-items.js | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/devtools/client/inspector/animation/test/browser_animation_animated-property-list_unchanged-items.js b/devtools/client/inspector/animation/test/browser_animation_animated-property-list_unchanged-items.js new file mode 100644 index 0000000000..22b889297f --- /dev/null +++ b/devtools/client/inspector/animation/test/browser_animation_animated-property-list_unchanged-items.js @@ -0,0 +1,58 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test the position and the class of unchanged animated property items. + +const TEST_DATA = [ + { property: "background-color", isUnchanged: false }, + { property: "padding-left", isUnchanged: false }, + { property: "background-attachment", isUnchanged: true }, + { property: "background-clip", isUnchanged: true }, + { property: "background-image", isUnchanged: true }, + { property: "background-origin", isUnchanged: true }, + { property: "background-position-x", isUnchanged: true }, + { property: "background-position-y", isUnchanged: true }, + { property: "background-repeat", isUnchanged: true }, + { property: "background-size", isUnchanged: true }, + { property: "padding-bottom", isUnchanged: true }, + { property: "padding-right", isUnchanged: true }, + { property: "padding-top", isUnchanged: true }, +]; + +add_task(async function () { + await addTab(URL_ROOT + "doc_simple_animation.html"); + await removeAnimatedElementsExcept([".longhand"]); + const { panel } = await openAnimationInspector(); + + info("Checking unchanged animated property item"); + const itemEls = panel.querySelectorAll(".animated-property-item"); + is( + itemEls.length, + TEST_DATA.length, + `Count of animated property item should be ${TEST_DATA.length}` + ); + + for (let i = 0; i < TEST_DATA.length; i++) { + const { property, isUnchanged } = TEST_DATA[i]; + const itemEl = itemEls[i]; + + ok( + itemEl.querySelector(`.keyframes-graph.${property}`), + `Item of ${property} should display at here` + ); + + if (isUnchanged) { + ok( + itemEl.classList.contains("unchanged"), + "Animated property item should have 'unchanged' class" + ); + } else { + ok( + !itemEl.classList.contains("unchanged"), + "Animated property item should not have 'unchanged' class" + ); + } + } +}); |