tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_animation_summary-graph_computed-timing-path_different-timescale.js (1527B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Test the Computed Timing Path component for different time scales.
      7 
      8 add_task(async function () {
      9  await addTab(URL_ROOT + "doc_simple_animation.html");
     10  await removeAnimatedElementsExcept([".animated", ".end-delay"]);
     11  const { animationInspector, inspector, panel } =
     12    await openAnimationInspector();
     13 
     14  info("Checking the path for different time scale");
     15  let onDetailRendered = animationInspector.once(
     16    "animation-keyframes-rendered"
     17  );
     18  await selectNode(".animated", inspector);
     19  await onDetailRendered;
     20  const itemA = await findAnimationItemByTargetSelector(panel, ".animated");
     21  const pathStringA = itemA
     22    .querySelector(".animation-iteration-path")
     23    .getAttribute("d");
     24 
     25  info("Select animation which has different time scale from no-compositor");
     26  onDetailRendered = animationInspector.once("animation-keyframes-rendered");
     27  await selectNode(".end-delay", inspector);
     28  await onDetailRendered;
     29 
     30  info("Select no-compositor again");
     31  onDetailRendered = animationInspector.once("animation-keyframes-rendered");
     32  await selectNode(".animated", inspector);
     33  await onDetailRendered;
     34  const itemB = await findAnimationItemByTargetSelector(panel, ".animated");
     35  const pathStringB = itemB
     36    .querySelector(".animation-iteration-path")
     37    .getAttribute("d");
     38  is(
     39    pathStringA,
     40    pathStringB,
     41    "Path string should be same even change the time scale"
     42  );
     43 });