Bug 1423241 - Ensure audio loads after video to make drawImage happy. r=jib

https://github.com/whatwg/html/issues/4128 filed to cover this case in the spec.

Differential Revision: https://phabricator.services.mozilla.com/D12270

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2018-11-23 15:01:01 +00:00
Родитель 2561e93cdb
Коммит 4be83b9661
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -41,6 +41,8 @@ runTest(async () => {
captureStreamElement.srcObject = gUMVideoElement.mozCaptureStream();
captureStreamElement.play();
await h.checkVideoPlaying(captureStreamElement);
// Adding a dummy audio track to the stream will keep a consuming media
// element from ending.
// We could also solve it by repeatedly play()ing or autoplay, but then we
@ -49,7 +51,6 @@ runTest(async () => {
let osc = createOscillatorStream(new AudioContext(), 1000);
captureStreamElement.srcObject.addTrack(osc.getTracks()[0]);
await h.checkVideoPlaying(captureStreamElement);
info("Video flowing. Pausing.");
gUMVideoElement.pause();
await h.checkVideoPaused(captureStreamElement, { time: pausedTimeout });