Bug 1292335 - Call mozCaptureStreamUntilEnded in loadedmetadata. r=pehrsons.
authorChia-hung Tai <ctai@mozilla.com>
Mon, 22 Aug 2016 11:01:27 +0800
changeset 311060 1da74b9e700014b87290c3fd43001ad679853549
parent 311059 60145a6103eec57335e5825be86bdbd68ceefc88
child 311061 5a6d14b38f484929a7e9a7679ced43701bf2e3c2
push id81034
push userryanvm@gmail.com
push dateThu, 25 Aug 2016 12:27:32 +0000
treeherdermozilla-inbound@87049fc2117f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1292335
milestone51.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 1292335 - Call mozCaptureStreamUntilEnded in loadedmetadata. r=pehrsons. MozReview-Commit-ID: 5S3jR9V23Yn
dom/media/test/test_streams_capture_origin.html
--- a/dom/media/test/test_streams_capture_origin.html
+++ b/dom/media/test/test_streams_capture_origin.html
@@ -19,20 +19,23 @@
 
 /** Test for Bug 1189506 **/
 
 SimpleTest.waitForExplicitFinish();
 
 var resource = getPlayableVideo(gSmallTests).name;
 
 vin.src = "http://example.org:8000/tests/dom/media/test/" + resource;
-var stream = vin.mozCaptureStreamUntilEnded();
-vout.srcObject = stream;
-vin.play();
-vout.play();
+vin.preload = "metadata";
+
+vin.onloadedmetadata = function () {
+  vout.srcObject = vin.mozCaptureStreamUntilEnded();
+  vin.play();
+  vout.play();
+};
 
 vout.onended = function() {
   var ctx = SpecialPowers.wrap(c.getContext("2d"));
   ctx.drawWindow(window, 0, 0, 10, 10, "rgb(255, 255, 0)", 0);
   var data = ctx.getImageData(2, 2, 1, 1);
   // Captured cross-origin video streams should render entirely black.
   is(data.data.join(','), "0,0,0,255", "expected black");
   vout.style.position = "";