[macOS WK2 Debug ] Flaky Test: animations/play-state-in-shorthand.html
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Oct 2019 18:57:27 +0000 (18:57 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Oct 2019 18:57:27 +0000 (18:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192501

Patch by Antoine Quint <graouts@apple.com> on 2019-10-07
Reviewed by Simon Fraser.

This test used to rely on timers to check the computed style at various animation times and also to check the "animation-play-state"
to "paused" via the "animation" shorthand CSS property. This was flaky by design since timers could not fire with high enough fidelity
to ensure the animation time matched the expectation. With the availability of the Web Animations API, we can simply use the "playState"
property on the Animation object reflecting the CSS animation to check that the change is accounted for.

* animations/play-state-in-shorthand-expected.txt:
* animations/play-state-in-shorthand.html:
* platform/ios-simulator-wk2/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250781 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/animations/play-state-in-shorthand-expected.txt
LayoutTests/animations/play-state-in-shorthand.html
LayoutTests/platform/ios-simulator-wk2/TestExpectations
LayoutTests/platform/mac/TestExpectations

index 180ee18..b4ddee3 100644 (file)
@@ -1,3 +1,20 @@
+2019-10-07  Antoine Quint  <graouts@apple.com>
+
+        [macOS WK2 Debug ] Flaky Test: animations/play-state-in-shorthand.html
+        https://bugs.webkit.org/show_bug.cgi?id=192501
+
+        Reviewed by Simon Fraser.
+
+        This test used to rely on timers to check the computed style at various animation times and also to check the "animation-play-state"
+        to "paused" via the "animation" shorthand CSS property. This was flaky by design since timers could not fire with high enough fidelity
+        to ensure the animation time matched the expectation. With the availability of the Web Animations API, we can simply use the "playState"
+        property on the Animation object reflecting the CSS animation to check that the change is accounted for.
+
+        * animations/play-state-in-shorthand-expected.txt:
+        * animations/play-state-in-shorthand.html:
+        * platform/ios-simulator-wk2/TestExpectations:
+        * platform/mac/TestExpectations:
+
 2019-10-07  Dirk Schulze  <krit@webkit.org>
 
         clip-path: <geometry-box> mapping incorrect
index 0df044b..ebf8b54 100644 (file)
@@ -1,4 +1,2 @@
-PASS - "transform" property for "box" element at 0.5s saw something close to: 1,0,0,1,75,0
-PASS - "transform" property for "box" element at 1s saw something close to: 1,0,0,1,150,0
-PASS - "transform" property for "box" element at 2.5s saw something close to: 1,0,0,1,150,0
-
+PASS - animation is running upon receiving animationstart event
+PASS - animation is paused after setting the animation-play-state property to paused through the shorthand
index eae2fb3..7193ca7 100644 (file)
       to   { transform: translateX(300px); }
     }
   </style>
-  <script src="resources/animation-test-helpers.js" type="text/javascript"></script>
-  <script type="text/javascript">
-    const expectedValues = [
-      // [animation-name, time, element-id, property, expected-value, tolerance]
-      ["move1", 0.5, "box", "transform", [1,0,0,1,75,0], 20],
-      ["move1", 1.0, "box", "transform", [1,0,0,1,150,0], 20],
-      ["move1", 2.5, "box", "transform", [1,0,0,1,150,0], 20],
-    ];
-
-    function pauseAnimation()
-    {
-        document.getElementById("box").classList.add('paused');
-    }
-
-    function setTimers()
-    {
-        setTimeout(pauseAnimation, 1000);
-    }
-
-    runAnimationTest(expectedValues, setTimers, null, true);
-  </script>
 </head>
 <body>
 <div id="box"></div>
 <div id="result"></div>
-</div>
+<script type="text/javascript">
+
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+        testRunner.waitUntilDone();
+    }
+
+    document.getElementById("box").addEventListener("animationstart", event => {
+        const animation = event.target.getAnimations()[0];
+        result.innerHTML += `${animation.playState == "running" ? "PASS" : "FAIL"} - animation is running upon receiving animationstart event<br>`;
+        event.target.classList.add("paused");
+        result.innerHTML += `${animation.playState == "paused" ? "PASS" : "FAIL"} - animation is paused after setting the animation-play-state property to paused through the shorthand`;
+
+        if (window.testRunner)
+            testRunner.notifyDone();
+    });
+</script>
 </body>
 </html>
index 204bd6f..4fcee53 100644 (file)
@@ -80,8 +80,6 @@ webkit.org/b/196944 imported/w3c/web-platform-tests/hr-time/test_cross_frame_sta
 
 webkit.org/b/197207 http/wpt/resource-timing/rt-resources-per-frame.html [ Pass Failure ]
 
-webkit.org/b/192501 animations/play-state-in-shorthand.html [ Pass Failure ]
-
 webkit.org/b/182849 imported/w3c/web-platform-tests/xhr/event-upload-progress-crossorigin.htm [ Pass Failure ]
 
 imported/w3c/web-platform-tests/IndexedDB/keypath-special-identifiers.htm [ Slow ]
index 9ce3922..fd49006 100644 (file)
@@ -1883,8 +1883,6 @@ imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_pointerlo
 imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_in_pointerlock-manual.html [ Skip ]
 imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_on_chorded_mouse_button_when_locked-manual.html [ Skip ]
 
-webkit.org/b/192501 [ Debug ] animations/play-state-in-shorthand.html [ Pass Failure ]
-
 webkit.org/b/197473 imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.sub.html [ Pass Failure ]
 
 webkit.org/b/136627 [ Mojave+ ] media/track/track-cue-rendering-vertical.html [ Failure ]