зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
1a97ad8bbb
Коммит
e2d541d341
|
@ -127,6 +127,7 @@ _TEST_FILES += \
|
|||
bug504644.ogv \
|
||||
bug506094.ogv \
|
||||
seek.ogv \
|
||||
short-video.ogv \
|
||||
small-shot.ogg \
|
||||
sound.ogg \
|
||||
$(NULL)
|
||||
|
|
|
@ -32,6 +32,8 @@ var gPlayTests = [
|
|||
{ name:"bug500311.ogv", type:"video/ogg", duration:1.96 },
|
||||
// Small audio file
|
||||
{ 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" }
|
||||
];
|
||||
|
|
Двоичный файл не отображается.
|
@ -52,8 +52,16 @@ function startTests() {
|
|||
setTimeout(startTests, 0);
|
||||
}
|
||||
}}(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("ended", checkEnded, false);
|
||||
v.addEventListener("timeupdate", timeUpdate, false);
|
||||
++testsWaiting;
|
||||
document.body.appendChild(v);
|
||||
v.play();
|
||||
|
|
Загрузка…
Ссылка в новой задаче