tor-browser

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

browser_animation_logic_adjust-time.js (1760B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Test adjusting the created time with different current times of animation.
      7 
      8 add_task(async function () {
      9  await addTab(URL_ROOT + "doc_custom_playback_rate.html");
     10  const { animationInspector, inspector, panel } =
     11    await openAnimationInspector();
     12 
     13  info(
     14    "Pause the all animation and set current time to middle time in order to " +
     15      "check the adjusting time"
     16  );
     17  clickOnPauseResumeButton(animationInspector, panel);
     18  await waitUntilAnimationsPlayState(animationInspector, "paused");
     19  clickOnCurrentTimeScrubberController(animationInspector, panel, 0.5);
     20 
     21  info("Check the created times of all animation are same");
     22  checkAdjustingTheTime(
     23    animationInspector.state.animations[0].state,
     24    animationInspector.state.animations[1].state
     25  );
     26 
     27  info("Change the current time to 75% after selecting '.div2'");
     28  await selectNode(".div2", inspector);
     29  await waitUntil(() => panel.querySelectorAll(".animation-item").length === 1);
     30  clickOnCurrentTimeScrubberController(animationInspector, panel, 0.75);
     31 
     32  info("Check each adjusted result of animations after selecting 'body' again");
     33  await selectNode("body", inspector);
     34  await waitUntil(() => panel.querySelectorAll(".animation-item").length === 2);
     35 
     36  checkAdjustingTheTime(
     37    animationInspector.state.animations[0].state,
     38    animationInspector.state.animations[1].state
     39  );
     40  is(
     41    animationInspector.state.animations[0].state.currentTime,
     42    50000,
     43    "The current time of '.div1' animation is 50%"
     44  );
     45  is(
     46    animationInspector.state.animations[1].state.currentTime,
     47    75000,
     48    "The current time of '.div2' animation is 75%"
     49  );
     50 });