Changeset 204304 in webkit


Ignore:
Timestamp:
Aug 9, 2016 2:54:58 PM (8 years ago)
Author:
adachan@apple.com
Message:

[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:
  • platform/mac-wk2/TestExpectations:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r204288 r204304  
     12016-08-09  Ada Chan  <adachan@apple.com>
     2
     3        [macOS Sierra] Fix flaky test: media/controls/picture-in-picture.html
     4        https://bugs.webkit.org/show_bug.cgi?id=160707
     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, we'll update the test so that we'll wait until the placeholder
     15        becomes visible before testing its visibility without the "controls" attribute.
     16
     17        * media/controls/picture-in-picture.html:
     18        * platform/mac-wk2/TestExpectations:
     19
    1202016-08-09  Chris Dumez  <cdumez@apple.com>
    221
  • trunk/LayoutTests/media/controls/picture-in-picture.html

    r202509 r204304  
    55        <script src="controls-test-helpers.js"></script>
    66        <script>
     7            var maxAttemptsToTestPlaceholderVisibility = 10;
     8            var attemptsToTestPlaceholderVisibility = 0;
     9
    710            if (window.internals)
    811                window.internals.settings.setAllowsPictureInPictureMediaPlayback(true);
     
    6366                    .isEqualTo("picture-in-picture");
    6467
     68                pollPIPPlaceholderVisibilityChange();
     69            }
     70
     71            function pollPIPPlaceholderVisibilityChange()
     72            {
    6573                const stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
     74                if (stateForPlaceholder.className.indexOf("hidden") >= 0) {
     75                    if (attemptsToTestPlaceholderVisibility > maxAttemptsToTestPlaceholderVisibility) {
     76                        tester.logFailure("Inline placeholder did not become visible after video enters picture-in-picture.");
     77                        tester.end();
     78                        return;
     79                    }
     80
     81                    // Use 33 to match PlaceholderPollingDelay in mediaControlsApple.js.
     82                    setTimeout(pollPIPPlaceholderVisibilityChange, 33);
     83                    attemptsToTestPlaceholderVisibility++;
     84                    return;
     85                }
     86
    6687                tester.test("Inline placeholder should be visible at this point")
    6788                    .value(stateForPlaceholder.className)
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r204164 r204304  
    473473# PiP tests are only enabled for Sierra WebKit2.
    474474# rdar://problem/27574303
    475 [ Sierra+ ] media/controls/picture-in-picture.html [ Pass Failure ]
     475[ Sierra+ ] media/controls/picture-in-picture.html [ Pass ]
    476476[ Sierra+ ] media/element-containing-pip-video-going-into-fullscreen.html [ Pass ]
    477477[ Sierra+ ] media/fullscreen-api-enabled-media-with-presentation-mode.html [ Pass ]
Note: See TracChangeset for help on using the changeset viewer.