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>
Reviewed by Oliver Hunt.
......
Test looping.
++ Test setting/removing the attribute
EXPECTED (video.getAttribute('loop') == 'null') OK
EXPECTED (video.loop == 'false') OK
RUN(video.loop = true)
......@@ -9,31 +6,21 @@ EXPECTED (video.getAttribute('loop') != 'null') OK
RUN(video.removeAttribute('loop'))
EXPECTED (video.loop == 'false') OK
++ Set 'loop' to true and start playing
RUN(video.loop = true)
RUN(video.src = 'content/test.mp4')
EVENT(play)
++ seek to near the end, wait for 'seeked' event to announce loop
EXPECTED (video.paused == 'false') OK
RUN(video.currentTime = video.duration - 0.4)
EVENT(seeked)
EVENT(seeked)
++ video just looped, toggle 'loop' and seek to near end
EXPECTED (video.paused == 'false') OK
EVENT(playing)
EXPECTED (video.ended == 'false') OK
EXPECTED (mediaElement.currentTime >= '0') OK
EXPECTED (mediaElement.currentTime < 'mediaElement.duration') OK
EXPECTED (mediaElement.currentTime > '0') OK
EXPECTED (mediaElement.currentTime < '5.63') OK
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 (mediaElement.currentTime == 'mediaElement.duration') OK
END OF TEST
<!DOCTYPE html>
<html>
<head>
<video controls autoplay ></video>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
var seekCount = 0;
function play()
{
consoleWrite("<br>++ seek to near the end, wait for 'seeked' event to announce loop");
testExpected("video.paused", false);
waitForEvent("seeked", seeked);
run("video.currentTime = video.duration - 0.4");
consoleWrite("");
}
testExpected("video.getAttribute('loop')", null);
testExpected("video.loop", false);
function seeked()
{
++seekCount;
if (seekCount == 2) {
consoleWrite("<br>++ video just looped, toggle 'loop' and seek to near end");
testExpected("video.paused", false);
testExpected("video.ended", false);
testExpected("mediaElement.currentTime", 0, '>=');
run("video.loop = true");
testExpected("video.loop", true);
testExpected("video.getAttribute('loop')", null, "!=");
// 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);
run("video.loop = false");
run("video.removeAttribute('loop')");
testExpected("video.loop", false);
var respondToTimeUpdate = false;
var firstTimeCheck = true;
waitForEvent('pause');
waitForEvent('playing');
// make sure we are playing, seek to near the end so the test doesn't take too long
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 as the floating point result may differ with different engines
// 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
reportExpected(mediaElement.currentTime == mediaElement.duration, "mediaElement.currentTime", "==", "mediaElement.duration", mediaElement.currentTime);
consoleWrite("");
endTest();
return;
}
function start()
{
findMediaElement();
testExpected("mediaElement.currentTime", 0, '>');
testExpected("mediaElement.currentTime", (video.duration - 0.4).toFixed(2), '<');
run("video.loop = false");
run("video.currentTime = video.duration - 0.3");
respondToTimeUpdate = true;
firstTimeCheck = false;
consoleWrite("++ Test setting/removing the attribute");
testExpected("video.getAttribute('loop')", null);
testExpected("video.loop", false);
consoleWrite("");
setTimeout(timeCheck, 800);
}
consoleWrite("");
run("video.loop = true");
testExpected("video.loop", true);
testExpected("video.getAttribute('loop')", null, "!=");
run("video.removeAttribute('loop')");
testExpected("video.loop", false);
waitForEvent('pause');
waitForEvent('play', play);
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;
run("video.src = '" + mediaFile + "'");
consoleWrite("");
}
</script>
</head>
<body>
<video controls autoplay ></video>
<p>Test looping.</p>
<script>start()</script>
</body>
</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