Changeset 53147 in webkit


Ignore:
Timestamp:
Jan 12, 2010 10:33:09 AM (14 years ago)
Author:
Philippe Normand
Message:

Reviewed by Eric Carlson.

[GTK] Failing media/video-seek-past-end-playing.html
https://bugs.webkit.org/show_bug.cgi?id=33015

Listen on timeupdate event instead of waiting a fixed amount of
time, which is prone to test flackyness.

  • media/audio-mpeg-supported.html:
  • media/video-seek-past-end-playing.html:
  • platform/gtk/Skipped:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r53146 r53147  
     12010-01-12  Philippe Normand  <pnormand@igalia.com>
     2
     3        Reviewed by Eric Carlson.
     4
     5        [GTK] Failing media/video-seek-past-end-playing.html
     6        https://bugs.webkit.org/show_bug.cgi?id=33015
     7
     8        Listen on timeupdate event instead of waiting a fixed amount of
     9        time, which is prone to test flackyness.
     10
     11        * media/audio-mpeg-supported.html:
     12        * media/video-seek-past-end-playing.html:
     13        * platform/gtk/Skipped:
     14
    1152010-01-12  Eric Carlson  <eric.carlson@apple.com>
    216
  • trunk/LayoutTests/media/audio-mpeg-supported.html

    r50063 r53147  
    88    <script src=video-test.js></script>
    99    <script>
     10        var timeupdateEventCount = 0;
    1011        mediaElement = document.getElementsByTagName('audio')[0];
    1112   
     
    1920            testExpected("mediaElement.currentTime", 0);
    2021            mediaElement.play();
    21             setTimeout(testCurrentTime, 500)
    2222        });
    2323
    24         function testCurrentTime()
     24        function timeupdate()
    2525        {
    26             testExpected("mediaElement.currentTime", 0, '>');
    27             endTest();
     26            ++timeupdateEventCount;
     27
     28            // wait 2 timeupdate events so we are sure the media engine is
     29            // playing the media.
     30            if (timeupdateEventCount == 2) {
     31               // make sure time is advancing
     32               testExpected("mediaElement.currentTime", 0, '>');
     33               // reset the counter to prevent infinite loop if the
     34               // test is re-executed manually.
     35               timeupdateEventCount = 0;
     36               endTest();
     37            }
    2838        }
    2939   
     40        mediaElement.addEventListener("timeupdate", timeupdate);
    3041        waitForEvent('play');
    3142   
  • trunk/LayoutTests/media/video-seek-past-end-playing.html

    r50063 r53147  
     1<html>
     2    <body>
     3
    14<video loop controls></video>
    25<p>Test that seeking video with 'loop' past it's end rewinds to the beginning and continues playback.</p>
     
    47<script src=video-test.js></script>
    58<script>
     9    var timeupdateEventCount = 0;
    610
    711    waitForEvent('canplaythrough', function () {
     
    913        run("video.play()");
    1014        testExpected("video.paused", false);
    11         setTimeout(timeCheck1, 200);
    1215    });
    1316
    14     function timeCheck1()
     17    function timeupdate()
    1518    {
    16         // make sure time is advancing, seek past end
    17         consoleWrite("");
    18         testExpected("video.paused", false);
    19         testExpected("mediaElement.currentTime", 0, '>');
    20         run("video.currentTime = 500");
    21         setTimeout(timeCheck2, 200);
     19        ++timeupdateEventCount;
     20
     21        // wait 2 timeupdate events so we are sure the media engine is
     22        // playing the media.
     23        if (timeupdateEventCount == 2) {
     24           consoleWrite("");
     25           testExpected("video.paused", false);
     26           // make sure time is advancing and seek past end
     27           testExpected("mediaElement.currentTime", 0, '>');
     28           run("video.currentTime = 500");
     29           setTimeout(seekCheck, 200);
     30        }
    2231    }
    2332
    24     function timeCheck2()
     33    function seekCheck()
    2534    {
    2635        consoleWrite("");
     
    2837        testExpected("mediaElement.currentTime", 0, '>');
    2938        consoleWrite("");
     39        // reset the counter to prevent infinite loop if the
     40        // test is re-executed manually.
     41        timeupdateEventCount = 0;
    3042        endTest();
    3143    }
    3244
     45    mediaElement.addEventListener("timeupdate", timeupdate);
    3346    var mediaFile = findMediaFile("video", "content/test");
    3447    run("video.src = '" + mediaFile + "'");
    3548    consoleWrite("");
    3649</script>
     50    </body>
     51</html>
Note: See TracChangeset for help on using the changeset viewer.