Bug 493431 - Add test to ensure video file with more audio than video plays and that video.currentTime only increases during playback. r=n/a

This commit is contained in:
Chris Pearce 2009-08-17 09:32:24 +12:00
parent 59e83ae8e9
commit 3bb5eed6a2
4 changed files with 11 additions and 0 deletions

View File

@ -127,6 +127,7 @@ _TEST_FILES += \
bug504644.ogv \ bug504644.ogv \
bug506094.ogv \ bug506094.ogv \
seek.ogv \ seek.ogv \
short-video.ogv \
small-shot.ogg \ small-shot.ogg \
sound.ogg \ sound.ogg \
$(NULL) $(NULL)

View File

@ -32,6 +32,8 @@ var gPlayTests = [
{ name:"bug500311.ogv", type:"video/ogg", duration:1.96 }, { name:"bug500311.ogv", type:"video/ogg", duration:1.96 },
// Small audio file // Small audio file
{ name:"small-shot.ogg", type:"video/ogg" }, { name:"small-shot.ogg", type:"video/ogg" },
// More audio in file than video.
{ name: "short-video.ogv", type:"video/ogg", duration:1.081 },
{ name:"bogus.duh", type:"bogus/duh" } { name:"bogus.duh", type:"bogus/duh" }
]; ];

Binary file not shown.

View File

@ -52,8 +52,16 @@ function startTests() {
setTimeout(startTests, 0); setTimeout(startTests, 0);
} }
}}(test, v); }}(test, v);
v.prevTime = 0;
var timeUpdate = function(v) { return function() {
ok(v.prevTime <= v.currentTime,
test.name + " time should run forwards: p=" +
v.prevTime + " c=" + v.currentTime);
v.prevTime = v.currentTime;
}}(v);
v.addEventListener("loadedmetadata", check, false); v.addEventListener("loadedmetadata", check, false);
v.addEventListener("ended", checkEnded, false); v.addEventListener("ended", checkEnded, false);
v.addEventListener("timeupdate", timeUpdate, false);
++testsWaiting; ++testsWaiting;
document.body.appendChild(v); document.body.appendChild(v);
v.play(); v.play();