Title: [206612] trunk/LayoutTests
Revision
206612
Author
adac...@apple.com
Date
2016-09-29 14:04:34 -0700 (Thu, 29 Sep 2016)

Log Message

Fix flaky test media/click-placeholder-not-pausing.html
https://bugs.webkit.org/show_bug.cgi?id=162661

Reviewed by Eric Carlson.

This test became flaky after r201474 when we started to delay showing
the inline placeholder until we are sure the video layer has been moved
into the video fullscreen layer. This means we can't guarantee that the
placeholder is visible right away after the video's presentation mode
changes to "picture-in-picture".

To fix this, wait for the placeholder to become visible before clicking it.

* media/click-placeholder-not-pausing.html:
* platform/mac-wk2/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (206611 => 206612)


--- trunk/LayoutTests/ChangeLog	2016-09-29 21:02:59 UTC (rev 206611)
+++ trunk/LayoutTests/ChangeLog	2016-09-29 21:04:34 UTC (rev 206612)
@@ -1,3 +1,21 @@
+2016-09-28  Ada Chan  <adac...@apple.com>
+
+        Fix flaky test media/click-placeholder-not-pausing.html
+        https://bugs.webkit.org/show_bug.cgi?id=162661
+
+        Reviewed by Eric Carlson.
+
+        This test became flaky after r201474 when we started to delay showing
+        the inline placeholder until we are sure the video layer has been moved
+        into the video fullscreen layer. This means we can't guarantee that the
+        placeholder is visible right away after the video's presentation mode
+        changes to "picture-in-picture".
+
+        To fix this, wait for the placeholder to become visible before clicking it.
+
+        * media/click-placeholder-not-pausing.html:
+        * platform/mac-wk2/TestExpectations:
+
 2016-09-29  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r206483.

Modified: trunk/LayoutTests/media/click-placeholder-not-pausing.html (206611 => 206612)


--- trunk/LayoutTests/media/click-placeholder-not-pausing.html	2016-09-29 21:02:59 UTC (rev 206611)
+++ trunk/LayoutTests/media/click-placeholder-not-pausing.html	2016-09-29 21:04:34 UTC (rev 206612)
@@ -7,7 +7,10 @@
     <script>
         var mediaElement;
         var placeholder;
+        var maxAttemptsToTestPlaceholderVisibility = 10;
+        var attemptsToTestPlaceholderVisibility = 0;
 
+
         if (window.internals)
             window.internals.settings.setAllowsPictureInPictureMediaPlayback(true);
 
@@ -38,7 +41,26 @@
         {
             testExpected("mediaElement.webkitPresentationMode", "picture-in-picture");
 
+            pollPIPPlaceholderVisibilityChange();
+        }
+
+        function pollPIPPlaceholderVisibilityChange()
+        {
             placeholder = mediaControlsElement(internals.shadowRoot(mediaElement), '-webkit-media-controls-wireless-playback-status');
+
+            if (placeholder.classList.contains('hidden')) {
+                if (attemptsToTestPlaceholderVisibility > maxAttemptsToTestPlaceholderVisibility) {
+                    failTest("Inline placeholder did not become visible after video enters picture-in-picture.");
+                    endTest();
+                    return;
+                }
+
+                // Use 33 to match PlaceholderPollingDelay in mediaControlsApple.js.
+                setTimeout(pollPIPPlaceholderVisibilityChange, 33);
+                attemptsToTestPlaceholderVisibility++;
+                return;
+            }
+
             testExpected("placeholder.classList.contains('hidden')", false);
 
             if (!window.eventSender) {

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (206611 => 206612)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2016-09-29 21:02:59 UTC (rev 206611)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2016-09-29 21:04:34 UTC (rev 206612)
@@ -472,8 +472,7 @@
 [ Sierra+ ] media/video-contained-in-fullscreen-element-going-into-pip.html [ Pass ]
 
 # rdar://problem/26885345
-[ Release Sierra+ ] media/click-placeholder-not-pausing.html [ Pass ]
-[ Debug Sierra+ ] media/click-placeholder-not-pausing.html [ Skip ]
+[ Sierra+ ] media/click-placeholder-not-pausing.html [ Pass ]
 
 # RTL Scrollbars are enabled on Sierra WebKit2.
 [ Sierra+ ] fast/scrolling/rtl-scrollbars.html [ Pass ]
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to