Bug 1423241 - Ensure audio loads after video to make drawImage happy. r=jib
authorAndreas Pehrson <apehrson@mozilla.com>
Fri, 23 Nov 2018 15:01:01 +0000
changeset 507044 7964b0b2f8363fbf1e5d3cdcc50b1d279987f1e9
parent 507043 69551bbbf203a1fe303ba319639094695f887467
child 507045 82afe83c9c4f59c73bdbbb62c4ab85f8ffb9906d
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1423241
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/media/tests/mochitest/test_getUserMedia_mediaElementCapture_video.html
--- a/dom/media/tests/mochitest/test_getUserMedia_mediaElementCapture_video.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_mediaElementCapture_video.html
@@ -36,25 +36,26 @@ runTest(async () => {
     gUMVideoElement.play();
 
     info("Capturing");
     captureStreamElement =
       createMediaElement("video", "captureStream");
     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
     // wouldn't be sure the media element stopped rendering video because it
     // went to the ended state or because there were no frames for the track.
     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 });
 
     info("Video stopped flowing. Playing.");
     gUMVideoElement.play();
     await h.checkVideoPlaying(captureStreamElement);