tor-browser

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

browser_animation_keyframes-graph_computed-value-path-02.js (2072B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Test for ComputedValuePath of animations that consist by one animated property
      7 // on complexed keyframes.
      8 
      9 requestLongerTimeout(2);
     10 
     11 const TEST_DATA = [
     12  {
     13    targetClass: "steps-effect",
     14    properties: [
     15      {
     16        name: "opacity",
     17        computedValuePathClass: "distance-path",
     18        expectedPathSegments: [
     19          { x: 0, y: 0 },
     20          { x: 250, y: 25 },
     21          { x: 500, y: 50 },
     22          { x: 750, y: 75 },
     23          { x: 1000, y: 100 },
     24        ],
     25      },
     26    ],
     27  },
     28  {
     29    targetClass: "steps-jump-none-keyframe",
     30    properties: [
     31      {
     32        name: "opacity",
     33        computedValuePathClass: "distance-path",
     34        expectedPathSegments: [
     35          { x: 0, y: 0 },
     36          { x: 199, y: 0 },
     37          { x: 200, y: 25 },
     38          { x: 399, y: 25 },
     39          { x: 400, y: 50 },
     40          { x: 599, y: 50 },
     41          { x: 600, y: 75 },
     42          { x: 799, y: 75 },
     43          { x: 800, y: 100 },
     44          { x: 1000, y: 100 },
     45        ],
     46      },
     47    ],
     48  },
     49  {
     50    targetClass: "narrow-offsets",
     51    properties: [
     52      {
     53        name: "opacity",
     54        computedValuePathClass: "distance-path",
     55        expectedPathSegments: [
     56          { x: 0, y: 0 },
     57          { x: 100, y: 100 },
     58          { x: 110, y: 100 },
     59          { x: 114.9, y: 100 },
     60          { x: 115, y: 50 },
     61          { x: 129.9, y: 50 },
     62          { x: 130, y: 0 },
     63          { x: 1000, y: 100 },
     64        ],
     65      },
     66    ],
     67  },
     68  {
     69    targetClass: "duplicate-offsets",
     70    properties: [
     71      {
     72        name: "opacity",
     73        computedValuePathClass: "distance-path",
     74        expectedPathSegments: [
     75          { x: 0, y: 100 },
     76          { x: 250, y: 100 },
     77          { x: 499, y: 100 },
     78          { x: 500, y: 100 },
     79          { x: 500, y: 0 },
     80          { x: 750, y: 50 },
     81          { x: 1000, y: 100 },
     82        ],
     83      },
     84    ],
     85  },
     86 ];
     87 
     88 add_task(async function () {
     89  await testKeyframesGraphComputedValuePath(TEST_DATA);
     90 });