Title: [213340] trunk/LayoutTests
Revision
213340
Author
commit-qu...@webkit.org
Date
2017-03-02 18:45:28 -0800 (Thu, 02 Mar 2017)

Log Message

LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=167348
<rdar://problem/30822186>

Patch by Antoine Quint <grao...@apple.com> on 2017-03-02
Reviewed by Tim Horton.

Since timing is hard to test accurately, simplify the test to only check that we're transitioning
from one state to another and use the asynchronous, polling-based assertions to check that we will
be transitioning between those two states (visible and faded).

* media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt:
* media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html:
* platform/mac/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (213339 => 213340)


--- trunk/LayoutTests/ChangeLog	2017-03-03 02:45:25 UTC (rev 213339)
+++ trunk/LayoutTests/ChangeLog	2017-03-03 02:45:28 UTC (rev 213340)
@@ -1,5 +1,21 @@
 2017-03-02  Antoine Quint  <grao...@apple.com>
 
+        LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=167348
+        <rdar://problem/30822186>
+
+        Reviewed by Tim Horton.
+
+        Since timing is hard to test accurately, simplify the test to only check that we're transitioning
+        from one state to another and use the asynchronous, polling-based assertions to check that we will
+        be transitioning between those two states (visible and faded).
+
+        * media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt:
+        * media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html:
+        * platform/mac/TestExpectations:
+
+2017-03-02  Antoine Quint  <grao...@apple.com>
+
         LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide.html is flaky
         https://bugs.webkit.org/show_bug.cgi?id=167263
         <rdar://problem/30821398>

Modified: trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt (213339 => 213340)


--- trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt	2017-03-03 02:45:25 UTC (rev 213339)
+++ trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt	2017-03-03 02:45:28 UTC (rev 213340)
@@ -3,18 +3,20 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-Video started playing, controls bar is visible by default.
-PASS controlsBar.classList.contains('faded') is false
+PASS !!shadowRoot.querySelector('.controls-bar') became true
 
-Auto-hide timer has elapsed, controls bar should be faded.
-PASS controlsBar.classList.contains('faded') is true
+Video started playing, controls bar should become visible by default.
+PASS shadowRoot.querySelector('.controls-bar').classList.contains('faded') became false
 
-Mouse moved over the media, controls bar should be visible.
-PASS controlsBar.classList.contains('faded') is false
+Controls bar should become faded when the auto-hide timer elapses.
+PASS shadowRoot.querySelector('.controls-bar').classList.contains('faded') became true
 
-Mouse moved out of the media, controls bar should be faded.
-PASS controlsBar.classList.contains('faded') is true
+Mouse moved over the media, controls bar should become visible again.
+PASS shadowRoot.querySelector('.controls-bar').classList.contains('faded') became false
 
+Mouse moved out of the media, controls bar should become faded.
+PASS shadowRoot.querySelector('.controls-bar').classList.contains('faded') became true
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html (213339 => 213340)


--- trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html	2017-03-03 02:45:25 UTC (rev 213339)
+++ trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html	2017-03-03 02:45:28 UTC (rev 213340)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <script src=""
 <body>
-<video src="" style="position: absolute; left: 0; top: 0; width: 320px; height: 240px;" controls autoplay data-auto-hide-delay="250"></video>
+<video src="" style="position: absolute; left: 0; top: 0; width: 320px; height: 240px;" controls autoplay></video>
 <script type="text/_javascript_">
 
 window.jsTestIsAsync = true;
@@ -8,39 +8,32 @@
 
 description("Testing the controls bar appears when the mouse enters and disappears when the mouse leaves the media.");
 
-let controlsBar;
+const media = document.querySelector("video");
+const shadowRoot = window.internals.shadowRoot(media);
 
-document.querySelector("video").addEventListener("play", (event) => {
-    window.requestAnimationFrame(() => {
-        const media = event.target;
-        controlsBar = window.internals.shadowRoot(media).querySelector(".controls-bar");
-
-        debug("Video started playing, controls bar is visible by default.");
-        shouldBeFalse("controlsBar.classList.contains('faded')");
-
-        setTimeout(() => {
+media.addEventListener("play", (event) => {
+    shouldBecomeEqual("!!shadowRoot.querySelector('.controls-bar')", "true", () => {
+        debug("");
+        debug("Video started playing, controls bar should become visible by default.");
+        shouldBecomeEqual("shadowRoot.querySelector('.controls-bar').classList.contains('faded')", "false", () => {
             debug("");
-            debug("Auto-hide timer has elapsed, controls bar should be faded.");
-            shouldBeTrue("controlsBar.classList.contains('faded')");
-
-            eventSender.mouseMoveTo(100, 100);
-            window.requestAnimationFrame(() => {
+            debug("Controls bar should become faded when the auto-hide timer elapses.");
+            shouldBecomeEqual("shadowRoot.querySelector('.controls-bar').classList.contains('faded')", "true", () => {
+                eventSender.mouseMoveTo(100, 100);
                 debug("");
-                debug("Mouse moved over the media, controls bar should be visible.");
-                shouldBeFalse("controlsBar.classList.contains('faded')");
-
-                eventSender.mouseMoveTo(400, 400);
-                window.requestAnimationFrame(() => {
+                debug("Mouse moved over the media, controls bar should become visible again.");
+                shouldBecomeEqual("shadowRoot.querySelector('.controls-bar').classList.contains('faded')", "false", () => {
+                    eventSender.mouseMoveTo(400, 400);
                     debug("");
-                    debug("Mouse moved out of the media, controls bar should be faded.");
-                    shouldBeTrue("controlsBar.classList.contains('faded')");
-
-                    debug("");
-                    media.remove();
-                    finishJSTest();
+                    debug("Mouse moved out of the media, controls bar should become faded.");
+                    shouldBecomeEqual("shadowRoot.querySelector('.controls-bar').classList.contains('faded')", "true", () => {
+                        debug("");
+                        media.remove();
+                        finishJSTest();
+                    });
                 });
             });
-        }, 300);
+        });
     });
 });
 

Modified: trunk/LayoutTests/platform/mac/TestExpectations (213339 => 213340)


--- trunk/LayoutTests/platform/mac/TestExpectations	2017-03-03 02:45:25 UTC (rev 213339)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2017-03-03 02:45:28 UTC (rev 213340)
@@ -1483,8 +1483,6 @@
 
 webkit.org/b/167275 media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html [ Pass Failure ]
 
-webkit.org/b/167347 media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html [ Pass Failure ]
-
 webkit.org/b/167266 media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-over-controls-bar.html [ Pass Failure ]
 
 webkit.org/b/167373 media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html [ Pass Failure ]
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to