browser_animation_animation-list.js (1115B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test that whether animations ui could be displayed 7 8 add_task(async function () { 9 await addTab(URL_ROOT + "doc_simple_animation.html"); 10 await removeAnimatedElementsExcept([".animated", ".long"]); 11 const { animationInspector, inspector, panel } = 12 await openAnimationInspector(); 13 14 info("Checking animation list and items existence"); 15 ok( 16 panel.querySelector(".animation-list"), 17 "The animation-list is in the DOM" 18 ); 19 is( 20 panel.querySelectorAll(".animation-list .animation-item").length, 21 animationInspector.state.animations.length, 22 "The number of animations displayed matches the number of animations" 23 ); 24 25 info( 26 "Checking list and items existence after select a element which has an animation" 27 ); 28 await selectNode(".animated", inspector); 29 await waitUntil( 30 () => panel.querySelectorAll(".animation-list .animation-item").length === 1 31 ); 32 ok( 33 true, 34 "The number of animations displayed should be 1 for .animated element" 35 ); 36 });