Bug 1314886 - Call mozCaptureStream() after "loadedmetadata" in test_streams_element_capture_reset. r=jwwang

MozReview-Commit-ID: 1i5VIfCWWRy

--HG--
extra : rebase_source : 00e78dc0214557bd53b773e918a56de8a56e9682
This commit is contained in:
Andreas Pehrson 2016-12-30 10:56:49 +01:00
Родитель dae2fad218
Коммит 4e5007c1c2
1 изменённых файлов: 16 добавлений и 8 удалений

Просмотреть файл

@ -17,8 +17,6 @@ SimpleTest.waitForExplicitFinish();
var v = document.getElementById('v');
var vout = document.getElementById('vout');
var vout_untilended = document.getElementById('vout_untilended');
vout.srcObject = v.mozCaptureStream();
vout_untilended.srcObject = v.mozCaptureStreamUntilEnded();
function dumpEvent(event) {
var v = event.target;
@ -101,17 +99,27 @@ function startTest(test) {
v.addEventListener("ended", ended, false);
vout_untilended.addEventListener("ended", ended, false);
v.src = test.name;
v.name = test.name;
v.play();
function checkNoEnded() {
ok(false, "ended event received unexpectedly");
};
vout.addEventListener("ended", checkNoEnded, false);
vout.play();
vout_untilended.play();
v.src = test.name;
v.name = test.name;
v.preload = "metadata";
function loadedmetadata() {
vout.srcObject = v.mozCaptureStream();
vout.play();
vout_untilended.srcObject = v.mozCaptureStreamUntilEnded();
vout_untilended.play();
v.play();
};
v.addEventListener("loadedmetadata", loadedmetadata, {once: true});
}
var testVideo = getPlayableVideo(gSmallTests);