Title: [207316] branches/safari-602-branch/LayoutTests
Revision
207316
Author
ryanhad...@apple.com
Date
2016-10-13 17:27:25 -0700 (Thu, 13 Oct 2016)

Log Message

Merge r204304.

Modified Paths

Diff

Modified: branches/safari-602-branch/LayoutTests/ChangeLog (207315 => 207316)


--- branches/safari-602-branch/LayoutTests/ChangeLog	2016-10-13 23:38:48 UTC (rev 207315)
+++ branches/safari-602-branch/LayoutTests/ChangeLog	2016-10-14 00:27:25 UTC (rev 207316)
@@ -1,5 +1,27 @@
 2016-10-13  Ryan Haddad  <ryanhad...@apple.com>
 
+        Merge r204304.
+
+    2016-08-09  Ada Chan  <adac...@apple.com>
+
+            [macOS Sierra] Fix flaky test: media/controls/picture-in-picture.html
+            https://bugs.webkit.org/show_bug.cgi?id=160707
+
+            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, we'll update the test so that we'll wait until the placeholder
+            becomes visible before testing its visibility without the "controls" attribute.
+
+            * media/controls/picture-in-picture.html:
+
+2016-10-13  Ryan Haddad  <ryanhad...@apple.com>
+
         Rebaseline failing LayoutTests.
 
         Unreviewed test gardening.

Modified: branches/safari-602-branch/LayoutTests/media/controls/picture-in-picture.html (207315 => 207316)


--- branches/safari-602-branch/LayoutTests/media/controls/picture-in-picture.html	2016-10-13 23:38:48 UTC (rev 207315)
+++ branches/safari-602-branch/LayoutTests/media/controls/picture-in-picture.html	2016-10-14 00:27:25 UTC (rev 207316)
@@ -4,6 +4,9 @@
         <script src=""
         <script src=""
         <script>
+            var maxAttemptsToTestPlaceholderVisibility = 10;
+            var attemptsToTestPlaceholderVisibility = 0;
+
             if (window.internals)
                 window.internals.settings.setAllowsPictureInPictureMediaPlayback(true);
 
@@ -62,7 +65,25 @@
                     .value(tester.media.webkitPresentationMode)
                     .isEqualTo("picture-in-picture");
 
+                pollPIPPlaceholderVisibilityChange();
+            }
+
+            function pollPIPPlaceholderVisibilityChange()
+            {
                 const stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
+                if (stateForPlaceholder.className.indexOf("hidden") >= 0) {
+                    if (attemptsToTestPlaceholderVisibility > maxAttemptsToTestPlaceholderVisibility) {
+                        tester.logFailure("Inline placeholder did not become visible after video enters picture-in-picture.");
+                        tester.end();
+                        return;
+                    }
+
+                    // Use 33 to match PlaceholderPollingDelay in mediaControlsApple.js.
+                    setTimeout(pollPIPPlaceholderVisibilityChange, 33);
+                    attemptsToTestPlaceholderVisibility++;
+                    return;
+                }
+
                 tester.test("Inline placeholder should be visible at this point")
                     .value(stateForPlaceholder.className)
                     .doesNotContain("hidden");
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to