Changeset 49941 in webkit


Ignore:
Timestamp:
Oct 22, 2009 8:53:11 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-10-22 Andrew Scherkus <scherkus@chromium.org>

Reviewed by Eric Carlson.

Fix video-played.js to use an error timeout based on time rather than function call count.

https://bugs.webkit.org/show_bug.cgi?id=30657

  • media/video-played.js: (nowInSecs): Returns the current time in seconds. (playForMillisecs.callPauseIfTimeIsReached): Change from call counts to using elapsed time. (playForMillisecs): Ditto.
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r49935 r49941  
     12009-10-22  Andrew Scherkus  <scherkus@chromium.org>
     2
     3        Reviewed by Eric Carlson.
     4
     5        Fix video-played.js to use an error timeout based on time rather than function call count.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=30657
     8
     9        * media/video-played.js:
     10        (nowInSecs): Returns the current time in seconds.
     11        (playForMillisecs.callPauseIfTimeIsReached): Change from call counts to using elapsed time.
     12        (playForMillisecs): Ditto.
     13
    1142009-10-22  Xan Lopez  <xlopez@igalia.com>
    215
  • trunk/LayoutTests/media/video-played.js

    r48539 r49941  
    9797}
    9898
     99function nowInSecs()
     100{
     101    return milliToSecs((new Date()).getTime());
     102}
     103
    99104function playForMillisecs(milliseconds)
    100105{
     
    106111    run("video.play()");
    107112
     113    var startTime = nowInSecs();
    108114    var playedFromTime = video.currentTime;
    109     var callCount = 0;
    110115    var playDuration = milliToSecs(milliseconds);
    111116    var callPauseIfTimeIsReached = function ()
     
    118123            playedTime = video.duration - playedFromTime + video.currentTime;
    119124        }
    120        
    121         if (callCount++ > 10) {
     125
     126        var elapsed = nowInSecs() - startTime;
     127        if (elapsed > 2) {
    122128            // Just in case something goes wrong.
    123             var elapsed = milliToSecs(callCount * milliseconds);
    124             failTest("ERROR: test stalled, waited " + milliToSecs(elapsed) + "seconds for movie to play " + playedTime + " seconds");
     129            failTest("ERROR: test stalled, waited " + elapsed + " seconds for movie to play " + playedTime + " seconds");
    125130            return;
    126131        }
Note: See TracChangeset for help on using the changeset viewer.