browser_animation_summary-graph_negative-end-delay-path.js (1523B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test for following NegativeEndDelayPath component works. 7 // * element existance 8 // * path 9 10 const TEST_DATA = [ 11 { 12 targetClass: "enddelay-positive", 13 }, 14 { 15 targetClass: "enddelay-negative", 16 expectedPath: [ 17 { x: 500000, y: 0 }, 18 { x: 500000, y: 50 }, 19 { x: 750000, y: 75 }, 20 { x: 1000000, y: 100 }, 21 { x: 1000000, y: 0 }, 22 ], 23 }, 24 ]; 25 26 add_task(async function () { 27 await addTab(URL_ROOT + "doc_multi_timings.html"); 28 await removeAnimatedElementsExcept(TEST_DATA.map(t => `.${t.targetClass}`)); 29 const { panel } = await openAnimationInspector(); 30 31 for (const { targetClass, expectedPath } of TEST_DATA) { 32 const animationItemEl = await findAnimationItemByTargetSelector( 33 panel, 34 `.${targetClass}` 35 ); 36 37 info(`Checking negative endDelay path existance for ${targetClass}`); 38 const negativeEndDelayPathEl = animationItemEl.querySelector( 39 ".animation-negative-end-delay-path" 40 ); 41 42 if (expectedPath) { 43 ok( 44 negativeEndDelayPathEl, 45 "The negative endDelay path element should be in animation item element" 46 ); 47 const pathEl = negativeEndDelayPathEl.querySelector("path"); 48 assertPathSegments(pathEl, true, expectedPath); 49 } else { 50 ok( 51 !negativeEndDelayPathEl, 52 "The negative endDelay path element should not be in animation item element" 53 ); 54 } 55 } 56 });