Changeset 156699 in webkit


Ignore:
Timestamp:
Sep 30, 2013 11:12:55 PM (11 years ago)
Author:
ap@apple.com
Message:

Layout Test media/click-volume-bar-not-pausing.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=122126

Reviewed by Darin Adler.

Speculative partial fix.

I'm not sure if it's possible to make this test completely controlled without
DOMFrameContentLoaded support - we need to do work when the <video> element is
already present, but playback hasn't started yet. As media documents use autoplay,
there is a race between load and playing events.

  • media/click-volume-bar-not-pausing-expected.txt:
  • media/click-volume-bar-not-pausing.html:
    • Add video URL after initial content fully loads to avoid races with that.
    • Added some state logging for clarity.
    • Only listen for "playing" event once. If playback already started, we have a playing event already queued, and would add another one with pause()/play().
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r156698 r156699  
     12013-09-30  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Layout Test media/click-volume-bar-not-pausing.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=122126
     5
     6        Reviewed by Darin Adler.
     7
     8        Speculative partial fix.
     9
     10        I'm not sure if it's possible to make this test completely controlled without
     11        DOMFrameContentLoaded support - we need to do work when the <video> element is
     12        already present, but playback hasn't started yet. As media documents use autoplay,
     13        there is a race between load and playing events.
     14
     15        * media/click-volume-bar-not-pausing-expected.txt:
     16        * media/click-volume-bar-not-pausing.html:
     17          - Add video URL after initial content fully loads to avoid races with that.
     18          - Added some state logging for clarity.
     19          - Only listen for "playing" event once. If playback already started, we have a
     20          playing event already queued, and would add another one with pause()/play().
     21
    1222013-09-30  Sam White  <samuel_white@apple.com>
    223
  • trunk/LayoutTests/media/click-volume-bar-not-pausing-expected.txt

    r148131 r156699  
    22
    33
     4Video frame loaded.
    45EVENT(playing)
    56EXPECTED (mediaElement.volume == '1') OK
  • trunk/LayoutTests/media/click-volume-bar-not-pausing.html

    r148131 r156699  
    99        <script type="text/javascript">
    1010            var mediaElement;
    11             var skipOnFirstEmptyLoad = 0;
    1211
    1312            function calculateElementCoordinates(id)
     
    3231            {
    3332                if (!window.eventSender) {
    34                     consoleWrite("ERROR: no event sender.");
    35                     failTest();
     33                    failTest("ERROR: no event sender.");
     34                    return;
    3635                }
    3736
     
    6362            function frameLoaded()
    6463            {
    65                 if (++skipOnFirstEmptyLoad == 1)
    66                     return;
     64                consoleWrite("Video frame loaded.");
    6765
    6866                var standaloneMediaDocument = document.getElementById("videoframe").contentDocument;
    6967                mediaElement = standaloneMediaDocument.querySelector("video");
     68                if (!mediaElement) {
     69                    failTest("ERROR: Video element was not found in frameLoaded().");
     70                    return;
     71                }
    7072
    7173                waitForEventAndFail("error");
    72                 waitForEvent('playing', playing);
     74                waitForEventOnce('playing', playing);
    7375
    7476                mediaElement.pause();
     
    8991    <body>
    9092        <p>Click on volume bar on a MediaDocument does not pause.</p>
    91         <iframe id="videoframe" width=380 height=330 onload="frameLoaded()"></iframe>
     93        <iframe id="videoframe" width=380 height=330"></iframe>
    9294        <script type="text/javascript">
    93             document.getElementById("videoframe").src = findMediaFile("video", "content/test");
     95            onload = function() {
     96                var videoframe = document.getElementById("videoframe");
     97                videoframe.onload = frameLoaded;
     98                videoframe.src = findMediaFile("video", "content/test");
     99            }
    94100        </script>
    95101    </body>
Note: See TracChangeset for help on using the changeset viewer.