2010-02-05 Eric Carlson <eric.carlson@apple.com>

        Unreviewed revert of r54454, until I can generate new results

        * media/video-loop-expected.txt:
        * media/video-loop.html:



git-svn-id: svn://svn.chromium.org/blink/trunk@54456 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 26617960
2010-02-05 Eric Carlson <eric.carlson@apple.com>
Unreviewed revert of r54454, until I can generate new results
* media/video-loop-expected.txt:
* media/video-loop.html:
2010-02-05 Eric Carlson <eric.carlson@apple.com> 2010-02-05 Eric Carlson <eric.carlson@apple.com>
Reviewed by Oliver Hunt. Reviewed by Oliver Hunt.
......
Test looping.
++ Test setting/removing the attribute
EXPECTED (video.getAttribute('loop') == 'null') OK EXPECTED (video.getAttribute('loop') == 'null') OK
EXPECTED (video.loop == 'false') OK EXPECTED (video.loop == 'false') OK
RUN(video.loop = true) RUN(video.loop = true)
...@@ -9,31 +6,21 @@ EXPECTED (video.getAttribute('loop') != 'null') OK ...@@ -9,31 +6,21 @@ EXPECTED (video.getAttribute('loop') != 'null') OK
RUN(video.removeAttribute('loop')) RUN(video.removeAttribute('loop'))
EXPECTED (video.loop == 'false') OK EXPECTED (video.loop == 'false') OK
++ Set 'loop' to true and start playing
RUN(video.loop = true) RUN(video.loop = true)
RUN(video.src = 'content/test.mp4') RUN(video.src = 'content/test.mp4')
EVENT(play) EVENT(play)
++ seek to near the end, wait for 'seeked' event to announce loop
EXPECTED (video.paused == 'false') OK EXPECTED (video.paused == 'false') OK
RUN(video.currentTime = video.duration - 0.4) RUN(video.currentTime = video.duration - 0.4)
EVENT(seeked) EVENT(playing)
EVENT(seeked)
++ video just looped, toggle 'loop' and seek to near end
EXPECTED (video.paused == 'false') OK
EXPECTED (video.ended == 'false') OK EXPECTED (video.ended == 'false') OK
EXPECTED (mediaElement.currentTime >= '0') OK EXPECTED (mediaElement.currentTime > '0') OK
EXPECTED (mediaElement.currentTime < 'mediaElement.duration') OK EXPECTED (mediaElement.currentTime < '5.63') OK
RUN(video.loop = false) RUN(video.loop = false)
RUN(video.currentTime = video.duration - 0.4) RUN(video.currentTime = video.duration - 0.3)
EVENT(seeked)
EVENT(ended)
EXPECTED (video.ended == 'true') OK EXPECTED (video.ended == 'true') OK
EXPECTED (mediaElement.currentTime == 'mediaElement.duration') OK EXPECTED (mediaElement.currentTime == 'mediaElement.duration') OK
END OF TEST END OF TEST
<!DOCTYPE html>
<html> <html>
<head>
<script src=media-file.js></script> <video controls autoplay ></video>
<script src=video-test.js></script>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
<script> testExpected("video.getAttribute('loop')", null);
var seekCount = 0; testExpected("video.loop", false);
function play() run("video.loop = true");
{ testExpected("video.loop", true);
consoleWrite("<br>++ seek to near the end, wait for 'seeked' event to announce loop"); testExpected("video.getAttribute('loop')", null, "!=");
testExpected("video.paused", false);
waitForEvent("seeked", seeked);
run("video.currentTime = video.duration - 0.4");
consoleWrite("");
}
function seeked() run("video.removeAttribute('loop')");
{ testExpected("video.loop", false);
++seekCount;
if (seekCount == 2) { var respondToTimeUpdate = false;
consoleWrite("<br>++ video just looped, toggle 'loop' and seek to near end"); var firstTimeCheck = true;
testExpected("video.paused", false);
testExpected("video.ended", false);
testExpected("mediaElement.currentTime", 0, '>=');
// don't use "testExpected()" so we won't log the actual duration as the floating point result may differ with different engines waitForEvent('pause');
reportExpected(mediaElement.currentTime < mediaElement.duration, "mediaElement.currentTime", "<", "mediaElement.duration", mediaElement.currentTime); waitForEvent('playing');
run("video.loop = false");
run("video.currentTime = video.duration - 0.4"); // make sure we are playing, seek to near the end so the test doesn't take too long
consoleWrite(""); waitForEvent('play', function () {
} testExpected("video.paused", false);
} run("video.currentTime = video.duration - 0.4");
consoleWrite("");
setTimeout(timeCheck, 800);
} );
function ended() function timeCheck() {
testExpected("video.ended", !firstTimeCheck);
if (!firstTimeCheck)
{ {
testExpected("video.ended", true); // don't use "testExpected()" so we won't log the actual duration to the
// results file, as the floating point result may differ with different engines
// don't use "testExpected()" so we won't log the actual duration as the floating point result may differ with different engines
reportExpected(mediaElement.currentTime == mediaElement.duration, "mediaElement.currentTime", "==", "mediaElement.duration", mediaElement.currentTime); reportExpected(mediaElement.currentTime == mediaElement.duration, "mediaElement.currentTime", "==", "mediaElement.duration", mediaElement.currentTime);
consoleWrite("");
endTest(); endTest();
return;
} }
function start() testExpected("mediaElement.currentTime", 0, '>');
{ testExpected("mediaElement.currentTime", (video.duration - 0.4).toFixed(2), '<');
findMediaElement(); run("video.loop = false");
run("video.currentTime = video.duration - 0.3");
consoleWrite("++ Test setting/removing the attribute"); respondToTimeUpdate = true;
testExpected("video.getAttribute('loop')", null); firstTimeCheck = false;
testExpected("video.loop", false);
consoleWrite("");
run("video.loop = true"); setTimeout(timeCheck, 800);
testExpected("video.loop", true); }
testExpected("video.getAttribute('loop')", null, "!=");
consoleWrite("");
run("video.removeAttribute('loop')"); run("video.loop = true");
testExpected("video.loop", false); var mediaFile = findMediaFile("video", "content/test");
run("video.src = '" + mediaFile + "'");
waitForEvent('pause'); consoleWrite("");
waitForEvent('play', play); </script>
waitForEvent("ended", ended);
consoleWrite("<br>++ Set 'loop' to true and start playing");
var mediaFile = findMediaFile("video", "content/test");
run("video.loop = true");
video.src = mediaFile;
consoleWrite("");
}
</script>
</head> </head>
<body>
<video controls autoplay ></video>
<p>Test looping.</p>
<script>start()</script>
</body>
</html> </html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment