Changeset 239607 in webkit


Ignore:
Timestamp:
Jan 4, 2019 6:34:39 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Flaky Test: http/wpt/css/css-animations/start-animation-001.html
https://bugs.webkit.org/show_bug.cgi?id=190903

This patch modifies start-animation-001.html to rely on the square positions returned by the
Web Process in order to know when they are supposed to be rendered behind the covering rect.
This should make it more robust while still testing the original bug 186129.

Patch by Frederic Wang <fwang@igalia.com> on 2019-01-04
Reviewed by Antonio Gomes.

  • http/wpt/css/css-animations/start-animation-001.html:
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r239604 r239607  
     12019-01-04  Frederic Wang  <fwang@igalia.com>
     2
     3        Flaky Test: http/wpt/css/css-animations/start-animation-001.html
     4        https://bugs.webkit.org/show_bug.cgi?id=190903
     5
     6        This patch modifies start-animation-001.html to rely on the square positions returned by the
     7        Web Process in order to know when they are supposed to be rendered behind the covering rect.
     8        This should make it more robust while still testing the original bug 186129.
     9
     10        Reviewed by Antonio Gomes.
     11
     12        * http/wpt/css/css-animations/start-animation-001.html:
     13
    1142019-01-03  Zalan Bujtas  <zalan@apple.com>
    215
  • trunk/LayoutTests/http/wpt/css/css-animations/start-animation-001.html

    r236541 r239607  
    5454    </style>
    5555    <script>
    56       function runTest() {
    57         if (!window.testRunner)
    58           return;
    59         // We wait a bit after the squares are moved behind the blue rectangle. For discontinuous
    60         // transforms we have 5000px / 100 steps = 5px/step. Hence this happens after 20 steps i.e.
    61         // 20/100*10s = 200ms.
    62         testRunner.waitUntilDone();
    63         setTimeout(() => { testRunner.notifyDone(); }, 300);
     56      function squareLeft(id) {
     57          var element = document.getElementById(id);
     58          if (id === "squareNonAccelerated")
     59              return element.getBoundingClientRect().left;
     60          var transform = window.getComputedStyle(element).getPropertyValue("transform");
     61          var match = /matrix\(1, 0, 0, 1, (.*), 0\)/.exec(transform);
     62          return match ? parseFloat(match[1]) : 0;
    6463      }
     64      function shouldBeHiddenByCoveringRect(id) {
     65          var coveringRectLeft = document.getElementById("coveringRect").getBoundingClientRect().left;
     66          return squareLeft(id) > coveringRectLeft;
     67      }
     68      // We wait until all the squares are moved behind the blue rectangle.
     69      if (window.testRunner)
     70          testRunner.waitUntilDone();
     71      function step() {
     72          if (["squareLinear", "squareSteps", "squareNonAccelerated"].every(shouldBeHiddenByCoveringRect)) {
     73              if (window.testRunner)
     74                  testRunner.notifyDone();
     75              return;
     76          }
     77          window.requestAnimationFrame(step);
     78      }
     79      window.requestAnimationFrame(step);
    6580    </script>
    6681  </head>
    67   <body onload="runTest()">
     82  <body>
    6883    <p>This test passes if green squares are moved behind the blue rectangle.</p>
    6984    <div id="container">
Note: See TracChangeset for help on using the changeset viewer.