browser_animation_animated-property-list.js (1385B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test following animated property list test. 7 // 1. Existence for animated property list. 8 // 2. Number of animated property item. 9 10 const TEST_DATA = [ 11 { 12 targetClass: "animated", 13 expectedNumber: 1, 14 }, 15 { 16 targetClass: "compositor-notall", 17 expectedNumber: 4, 18 }, 19 ]; 20 21 add_task(async function () { 22 await addTab(URL_ROOT + "doc_simple_animation.html"); 23 await removeAnimatedElementsExcept(TEST_DATA.map(t => `.${t.targetClass}`)); 24 const { animationInspector, panel } = await openAnimationInspector(); 25 26 info("Checking animated property list and items existence at initial"); 27 ok( 28 !panel.querySelector(".animated-property-list"), 29 "The animated-property-list should not be in the DOM at initial" 30 ); 31 32 for (const { targetClass, expectedNumber } of TEST_DATA) { 33 info( 34 `Checking animated-property-list and items existence at ${targetClass}` 35 ); 36 await clickOnAnimationByTargetSelector( 37 animationInspector, 38 panel, 39 `.${targetClass}` 40 ); 41 42 await waitUntil( 43 () => 44 panel.querySelectorAll(".animated-property-item").length === 45 expectedNumber 46 ); 47 ok( 48 true, 49 `The number of animated-property-list should be ${expectedNumber} at ${targetClass}` 50 ); 51 } 52 });