Changeset 206612 in webkit


Ignore:
Timestamp:
Sep 29, 2016, 2:04:34 PM (9 years ago)
Author:
adachan@apple.com
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:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r206611 r206612  
     12016-09-28  Ada Chan  <adachan@apple.com>
     2
     3        Fix flaky test media/click-placeholder-not-pausing.html
     4        https://bugs.webkit.org/show_bug.cgi?id=162661
     5
     6        Reviewed by Eric Carlson.
     7
     8        This test became flaky after r201474 when we started to delay showing
     9        the inline placeholder until we are sure the video layer has been moved
     10        into the video fullscreen layer. This means we can't guarantee that the
     11        placeholder is visible right away after the video's presentation mode
     12        changes to "picture-in-picture".
     13
     14        To fix this, wait for the placeholder to become visible before clicking it.
     15
     16        * media/click-placeholder-not-pausing.html:
     17        * platform/mac-wk2/TestExpectations:
     18
    1192016-09-29  Commit Queue  <commit-queue@webkit.org>
    220
  • trunk/LayoutTests/media/click-placeholder-not-pausing.html

    r202219 r206612  
    88        var mediaElement;
    99        var placeholder;
     10        var maxAttemptsToTestPlaceholderVisibility = 10;
     11        var attemptsToTestPlaceholderVisibility = 0;
     12
    1013
    1114        if (window.internals)
     
    3942            testExpected("mediaElement.webkitPresentationMode", "picture-in-picture");
    4043
     44            pollPIPPlaceholderVisibilityChange();
     45        }
     46
     47        function pollPIPPlaceholderVisibilityChange()
     48        {
    4149            placeholder = mediaControlsElement(internals.shadowRoot(mediaElement), '-webkit-media-controls-wireless-playback-status');
     50
     51            if (placeholder.classList.contains('hidden')) {
     52                if (attemptsToTestPlaceholderVisibility > maxAttemptsToTestPlaceholderVisibility) {
     53                    failTest("Inline placeholder did not become visible after video enters picture-in-picture.");
     54                    endTest();
     55                    return;
     56                }
     57
     58                // Use 33 to match PlaceholderPollingDelay in mediaControlsApple.js.
     59                setTimeout(pollPIPPlaceholderVisibilityChange, 33);
     60                attemptsToTestPlaceholderVisibility++;
     61                return;
     62            }
     63
    4264            testExpected("placeholder.classList.contains('hidden')", false);
    4365
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r206559 r206612  
    473473
    474474# rdar://problem/26885345
    475 [ Release Sierra+ ] media/click-placeholder-not-pausing.html [ Pass ]
    476 [ Debug Sierra+ ] media/click-placeholder-not-pausing.html [ Skip ]
     475[ Sierra+ ] media/click-placeholder-not-pausing.html [ Pass ]
    477476
    478477# RTL Scrollbars are enabled on Sierra WebKit2.
Note: See TracChangeset for help on using the changeset viewer.