Changeset 232736 in webkit


Ignore:
Timestamp:
Jun 11, 2018 5:11:02 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Layout Test svg/dom/animated-tearoff-list-remove-target.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=185698
<rdar://problem/40341200>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-06-11
Reviewed by Daniel Bates.

The test is flaky because we get the animVal.getItem(0) of the 'x' attribute
from the target element without initializing this attribute with a base value.

The test assumes the animator would set the animVal of the 'x' attribute
from the 'from' attribute of the <animate> element before animVal.getItem(0)
is executed. But this may not always happen. Therefore the test will get
the 'IndexSizeError' exception and it will time out.

The fix is:
-- Initialize the attribute of the target element by a base value.
-- Use requestAnimationFrame() instead of using setTimeout() to make the

test deterministic.

-- Allow the animation to advance one more step after kicking off the GC

to ensure the variable 'animItem' is detached from animVal.getItem(0).

  • svg/dom/animated-tearoff-list-remove-target.html:
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r232735 r232736  
     12018-06-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        Layout Test svg/dom/animated-tearoff-list-remove-target.html is a flaky timeout
     4        https://bugs.webkit.org/show_bug.cgi?id=185698
     5        <rdar://problem/40341200>
     6
     7        Reviewed by Daniel Bates.
     8
     9        The test is flaky because we get the animVal.getItem(0) of the 'x' attribute
     10        from the target element without initializing this attribute with a base value.
     11
     12        The test assumes the animator would set the animVal of the 'x' attribute
     13        from the 'from' attribute of the <animate> element before animVal.getItem(0)
     14        is executed. But this may not always happen. Therefore the test will get
     15        the 'IndexSizeError' exception and it will time out.
     16
     17        The fix is:
     18        -- Initialize the attribute of the target element by a base value.
     19        -- Use requestAnimationFrame() instead of using setTimeout() to make the
     20           test deterministic.
     21        -- Allow the animation to advance one more step after kicking off the GC
     22           to ensure the variable 'animItem' is detached from animVal.getItem(0).
     23
     24        * svg/dom/animated-tearoff-list-remove-target.html:
     25
    1262018-06-11  Jer Noble  <jer.noble@apple.com>
    227
  • trunk/LayoutTests/svg/dom/animated-tearoff-list-remove-target.html

    r230172 r232736  
    44    <svg>
    55        <text x="15" y="40">
    6             <tspan id="first-tspan">First tspan.</tspan>
     6            <tspan id="first-tspan" x="0">First tspan.</tspan>
    77        </text>
    88        <text x="15" y="60">
    9             <tspan id="second-tspan">Second tspan</tspan>
     9            <tspan id="second-tspan" x="0">Second tspan</tspan>
    1010        </text>
    1111        <animate id="animate" xlink:href="#first-tspan" attributeType="XML" attributeName="x" from="0" to="100" dur="10s" repeatCount="indefinite"/>
     
    2727            }
    2828
    29             setTimeout(() => {
     29            window.requestAnimationFrame(() => {
    3030                // The target of the <animate> element is the "first-tspan".
    3131                var tspanElement = document.getElementById("first-tspan");
     
    4242                // of an SVGLength. animItem should not be affected if garbage collection is forced.
    4343                gc();
    44                 if (animItem.valueAsString == "0") {
    45                     document.querySelector("div").innerHTML += "<br><br>PASS."
    46                     document.querySelector("svg").remove();
    47                 }
     44                window.requestAnimationFrame(() => {
     45                    if (animItem.valueAsString == "0") {
     46                        document.querySelector("div").innerHTML += "<br><br>PASS."
     47                        document.querySelector("svg").remove();
     48                    }
    4849
    49                 if (window.testRunner)
    50                     testRunner.notifyDone();
    51             }, 0);
     50                    if (window.testRunner)
     51                        testRunner.notifyDone();
     52                });
     53            });
    5254        })();
    5355    </script>
Note: See TracChangeset for help on using the changeset viewer.