tor-browser

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

browser_animation_rewind-button.js (1368B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 requestLongerTimeout(2);
      7 
      8 // Test for following RewindButton component:
      9 // * element existence
     10 // * make animations to rewind to zero
     11 // * the state should be always paused after rewinding
     12 
     13 add_task(async function () {
     14  await addTab(URL_ROOT + "doc_multi_timings.html");
     15  await removeAnimatedElementsExcept([".delay-negative", ".delay-positive"]);
     16  const { animationInspector, panel } = await openAnimationInspector();
     17 
     18  info("Checking button existence");
     19  ok(panel.querySelector(".rewind-button"), "Rewind button should exist");
     20 
     21  info("Checking rewind button makes animations to rewind to zero");
     22  clickOnRewindButton(animationInspector, panel);
     23  await waitUntilAnimationsPlayState(animationInspector, "paused");
     24  await waitUntilCurrentTimeChangedAt(animationInspector, 0);
     25  ok(true, "Rewind button make current time 0");
     26 
     27  info("Checking rewind button makes animations after clicking scrubber");
     28  clickOnCurrentTimeScrubberController(animationInspector, panel, 0.5);
     29  clickOnRewindButton(animationInspector, panel);
     30  await waitUntilCurrentTimeChangedAt(animationInspector, 0);
     31  await waitUntilAnimationsPlayState(animationInspector, "paused");
     32  ok(true, "Rewind button make current time 0 even after clicking scrubber");
     33 });