tor-browser

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

browser_animation_animation-detail_title.js (1216B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Test that whether title in header of animations detail.
      7 
      8 const TEST_DATA = [
      9  {
     10    targetClass: "cssanimation-normal",
     11    expectedTitle: "cssanimation — CSS Animation",
     12  },
     13  {
     14    targetClass: "delay-positive",
     15    expectedTitle: "test-delay-animation — Script Animation",
     16  },
     17  {
     18    targetClass: "easing-step",
     19    expectedTitle: "Script Animation",
     20  },
     21 ];
     22 
     23 add_task(async function () {
     24  await addTab(URL_ROOT + "doc_multi_timings.html");
     25  await removeAnimatedElementsExcept(TEST_DATA.map(t => `.${t.targetClass}`));
     26  const { animationInspector, panel } = await openAnimationInspector();
     27 
     28  info("Checking title in each header of animation detail");
     29 
     30  for (const { targetClass, expectedTitle } of TEST_DATA) {
     31    info(`Checking title at ${targetClass}`);
     32    await clickOnAnimationByTargetSelector(
     33      animationInspector,
     34      panel,
     35      `.${targetClass}`
     36    );
     37    const titleEl = panel.querySelector(".animation-detail-title");
     38    is(
     39      titleEl.textContent,
     40      expectedTitle,
     41      `Title of "${targetClass}" should be "${expectedTitle}"`
     42    );
     43  }
     44 });