browser_animation_short-duration.js (1182B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test tooltips and iteration path of summary graph with short duration animation. 7 8 add_task(async function () { 9 await addTab(URL_ROOT + "doc_short_duration.html"); 10 const { panel } = await openAnimationInspector(); 11 12 const animationItemEl = await findAnimationItemByTargetSelector( 13 panel, 14 ".short" 15 ); 16 const summaryGraphEl = animationItemEl.querySelector( 17 ".animation-summary-graph" 18 ); 19 20 info("Check tooltip"); 21 assertTooltip(summaryGraphEl); 22 23 info("Check iteration path"); 24 assertIterationPath(summaryGraphEl); 25 }); 26 27 function assertTooltip(summaryGraphEl) { 28 const tooltip = summaryGraphEl.getAttribute("title"); 29 const expected = "Duration: 0s"; 30 ok(tooltip.includes(expected), `Tooltip should include '${expected}'`); 31 } 32 33 function assertIterationPath(summaryGraphEl) { 34 const pathEl = summaryGraphEl.querySelector( 35 ".animation-computed-timing-path .animation-iteration-path" 36 ); 37 const expected = [ 38 { x: 0, y: 0 }, 39 { x: 0.999, y: 99.9 }, 40 { x: 1, y: 0 }, 41 ]; 42 assertPathSegments(pathEl, true, expected); 43 }