Bug 1175523 - Update most (but not all) tests to use elem.srcObject over .mozSrcObject. r=pehrsons
authorJan-Ivar Bruaroey <jib@mozilla.com>
Tue, 14 Jul 2015 10:12:31 -0400
changeset 287631 79d3b8d912500dfc4705573c8036a0b9c91575f7
parent 287630 dff0fcf398a1359440ee7939abad80151a2dcdc3
child 287632 c6b30a85cc23d50197e799b31fee20ba1585554e
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1175523
milestone42.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 1175523 - Update most (but not all) tests to use elem.srcObject over .mozSrcObject. r=pehrsons
dom/camera/test/camera_common.js
dom/camera/test/test_bug1104913.html
dom/camera/test/test_camera.html
dom/camera/test/test_camera_2.html
dom/camera/test/test_camera_3.html
dom/canvas/test/captureStream_common.js
dom/canvas/test/reftest/capturestream.html
dom/canvas/test/reftest/webgl-capturestream-test.html
dom/canvas/test/test_capture.html
dom/canvas/test/webgl-mochitest/test_capture.html
dom/media/test/manifest.js
dom/media/test/test_bug879717.html
dom/media/test/test_mediarecorder_record_4ch_audiocontext.html
dom/media/test/test_mediarecorder_record_audiocontext.html
dom/media/test/test_mediatrack_consuming_mediastream.html
dom/media/test/test_multiple_mediastreamtracks.html
dom/media/test/test_streams_autoplay.html
dom/media/test/test_streams_element_capture.html
dom/media/test/test_streams_element_capture_reset.html
dom/media/test/test_streams_srcObject.html
dom/media/tests/mochitest/blacksilence.js
dom/media/tests/mochitest/mediaStreamPlayback.js
dom/media/tests/mochitest/pc.js
dom/media/tests/mochitest/test_getUserMedia_basicVideo_playAfterLoadedmetadata.html
dom/media/tests/mochitest/test_peerConnection_promiseSendOnly.html
dom/media/webaudio/test/test_mediaStreamAudioDestinationNode.html
mobile/android/tests/browser/robocop/robocop_getusermedia.html
--- a/dom/camera/test/camera_common.js
+++ b/dom/camera/test/camera_common.js
@@ -80,17 +80,17 @@ function CameraTestSuite() {
   this.rejectTakePicture = this._rejectTakePicture.bind(this);
   this.rejectStartRecording = this._rejectStartRecording.bind(this);
   this.rejectStopRecording = this._rejectStopRecording.bind(this);
   this.rejectPreviewStarted = this._rejectPreviewStarted.bind(this);
 
   var self = this;
   this._window.addEventListener('beforeunload', function() {
     if (isDefinedObj(self.viewfinder)) {
-      self.viewfinder.mozSrcObject = null;
+      self.viewfinder.srcObject = null;
     }
 
     self.hw = null;
     if (isDefinedObj(self.camera)) {
       ok(false, 'window unload triggered camera release instead of test completion');
       self.camera.release();
       self.camera = null;
     }
@@ -206,17 +206,17 @@ CameraTestSuite.prototype = {
 
       function resetLowMem() {
         return self.setLowMemoryPlatform(false);
       }
 
       function postTest(pass) {
         ok(pass, test.name + ' finished');
         var camera = self.camera;
-        self.viewfinder.mozSrcObject = null;
+        self.viewfinder.srcObject = null;
         self.camera = null;
 
         if (!isDefinedObj(camera)) {
           return Promise.resolve();
         }
 
         function handler(e) {
           ok(typeof(e) === 'undefined', 'camera released');
@@ -320,17 +320,17 @@ CameraTestSuite.prototype = {
         }
       }
 
       if (!isDefinedObj(self.viewfinder)) {
         reject(new Error('no viewfinder object'));
         return;
       }
 
-      self.viewfinder.mozSrcObject = self.camera;
+      self.viewfinder.srcObject = self.camera;
       self.viewfinder.play();
       self.camera.addEventListener('previewstatechange', onPreviewStateChange);
     });
   },
 
   /* Returns a promise which resolves when the camera hardware
      has received a push parameters request. This is useful
      when setting camera parameters from the application and
--- a/dom/camera/test/test_bug1104913.html
+++ b/dom/camera/test/test_bug1104913.html
@@ -37,17 +37,17 @@ var Camera = {
     return document.getElementById('viewfinder');
   },
 
   start: function test_start() {
     function getCamera_onSuccess(d) {
       var camera = d.camera;
       var cfg = d.configuration;
       Camera.cameraObj = camera;
-      Camera.viewfinder.mozSrcObject = camera;
+      Camera.viewfinder.srcObject = camera;
       Camera.viewfinder.play();
 
       // Check the default configuration
       ok(cfg.mode === config.mode, "Initial mode = " + cfg.mode);
       ok(cfg.previewSize.width === config.previewSize.width &&
          cfg.previewSize.height === config.previewSize.height,
          "Initial preview size = " + cfg.previewSize.width + "x" + cfg.previewSize.height);
       ok(cfg.pictureSize.width === config.pictureSize.width &&
@@ -61,17 +61,17 @@ var Camera = {
 
     navigator.mozCameras.getCamera(whichCamera, {}).then(getCamera_onSuccess, onError);
   }
 }
 
 SimpleTest.waitForExplicitFinish();
 
 window.addEventListener('beforeunload', function() {
-  Camera.viewfinder.mozSrcObject = null;
+  Camera.viewfinder.srcObject = null;
   if (Camera.cameraObj) {
     Camera.cameraObj.release();
     Camera.cameraObj = null;
   }
 });
 
 Camera.start();
 
--- a/dom/camera/test/test_camera.html
+++ b/dom/camera/test/test_camera.html
@@ -227,30 +227,30 @@ var Camera = {
   },
   setUp: function setup_tests() {
     function onSuccess(d) {
       Camera.cameraObj = d.camera;
       Camera.cameraObj.addEventListener('previewstatechange', Camera.onPreviewStateChange);
       Camera.cameraObj.addEventListener('configurationchanged', Camera.onConfigChange);
       Camera.cameraObj.addEventListener('shutter', Camera.shutter);
       Camera.cameraObj.addEventListener('picture', Camera.takePictureEvent.bind(Camera));
-      Camera.viewfinder.mozSrcObject = d.camera;
+      Camera.viewfinder.srcObject = d.camera;
       Camera.viewfinder.play();
       SimpleTest.expectAssertions(0);
       ok(true, "Camera Control object has been successfully initialized");
       Camera.cameraObj.setConfiguration(options).then(Camera.onConfigChange, onError);
     };
     navigator.mozCameras.getCamera(whichCamera, null).then(onSuccess, onError);
   }
 }
 
 SimpleTest.waitForExplicitFinish();
 
 window.addEventListener('beforeunload', function() {
-  Camera.viewfinder.mozSrcObject = null;
+  Camera.viewfinder.srcObject = null;
   Camera.cameraObj.release();
   Camera.cameraObj = null;
 });
 
 Camera.setUp();
 
 </script>
 </body>
--- a/dom/camera/test/test_camera_2.html
+++ b/dom/camera/test/test_camera_2.html
@@ -174,28 +174,28 @@ var Camera = {
       ok(config.mode === options.mode, "configuration mode = " + config.mode);
       ok(config.recorderProfile === options.recorderProfile, "recorder profile = " + config.recorderProfile);
       ok(config.previewSize.width === options.previewSize.width &&
         config.previewSize.height === options.previewSize.height,
         "preview size (w x h) = " + config.previewSize.width + " x " + config.previewSize.height);
       Camera.cameraObj = d.camera;
       Camera.cameraObj.addEventListener('previewstatechange', Camera.onPreviewStateChange);
       Camera.cameraObj.addEventListener('shutter', Camera.shutter);
-      Camera.viewfinder.mozSrcObject = d.camera;
+      Camera.viewfinder.srcObject = d.camera;
       Camera.viewfinder.play();
       SimpleTest.expectAssertions(0);
     };
     navigator.mozCameras.getCamera(whichCamera, options).then(onSuccess, onError);
   }
 }
 
 SimpleTest.waitForExplicitFinish();
 
 window.addEventListener('beforeunload', function() {
-  Camera.viewfinder.mozSrcObject = null;
+  Camera.viewfinder.srcObject = null;
   Camera.cameraObj.release();
   Camera.cameraObj = null;
 });
 
 Camera.setUp();
 
 </script>
 </body>
--- a/dom/camera/test/test_camera_3.html
+++ b/dom/camera/test/test_camera_3.html
@@ -49,27 +49,27 @@ var Camera = {
   },
   release: function release() {
     cameraObj = null;
   },
   start: function run_test() {
     function onSuccess(d) {
       Camera.cameraObj = d.camera;
       Camera.cameraObj.addEventListener('previewstatechange', Camera.onPreviewStateChange);
-      Camera.viewfinder.mozSrcObject = d.camera;
+      Camera.viewfinder.srcObject = d.camera;
       Camera.viewfinder.play();
     };
     navigator.mozCameras.getCamera(whichCamera, options).then(onSuccess, onError);
   }
 }
 
 SimpleTest.waitForExplicitFinish();
 
 window.addEventListener('beforeunload', function() {
-  Camera.viewfinder.mozSrcObject = null;
+  Camera.viewfinder.srcObject = null;
   Camera.cameraObj.release();
   Camera.cameraObj = null;
 });
 
 Camera.start();
 
 </script>
 </body>
--- a/dom/canvas/test/captureStream_common.js
+++ b/dom/canvas/test/captureStream_common.js
@@ -30,17 +30,17 @@ CaptureStreamTestHelper.prototype = {
 
   /* Default element size for createAndAppendElement() */
   elemWidth: 100,
   elemHeight: 100,
 
   /* Request a frame from the stream played by |video|. */
   requestFrame: function (video) {
     info("Requesting frame from " + video.id);
-    video.mozSrcObject.requestFrame();
+    video.srcObject.requestFrame();
   },
 
   /* Tests the top left pixel of |video| against |refData|. Format [R,G,B,A]. */
   testPixel: function (video, refData, threshold) {
     var ctxout = this.cout.getContext('2d');
     ctxout.drawImage(video, 0, 0);
     var pixel = ctxout.getImageData(0, 0, 1, 1).data;
     return pixel.every((val, i) => Math.abs(val - refData[i]) <= threshold);
--- a/dom/canvas/test/reftest/capturestream.html
+++ b/dom/canvas/test/reftest/capturestream.html
@@ -14,17 +14,17 @@ function finished() {
 
 function runTest() {
   var canvas = document.getElementById('canvas');
   var context = canvas.getContext('2d');
   context.fillStyle = "rgba(0, 255, 0, 1)";
   context.fillRect(0, 0, canvas.width, canvas.height);
 
   var video = document.getElementById('video');
-  video.mozSrcObject = canvas.captureStream(0);
+  video.srcObject = canvas.captureStream(0);
   video.play();
   video.onloadeddata = finished;
   video.onerror = finished;
 }
   </script>
 </head>
 
 <body onload='runTest();'>
--- a/dom/canvas/test/reftest/webgl-capturestream-test.html
+++ b/dom/canvas/test/reftest/webgl-capturestream-test.html
@@ -28,17 +28,17 @@ function runTest() {
     setStatus('WebGL context creation failed.');
     return;
   }
 
   gl.clearColor(0.0, 1.0, 0.0, 1.0);
   gl.clear(gl.COLOR_BUFFER_BIT);
 
   var video = document.getElementById('video');
-  video.mozSrcObject = canvas.captureStream(0);
+  video.srcObject = canvas.captureStream(0);
   video.play();
   video.onloadeddata = finished;
   video.onerror = finished;
 }
   </script>
 </head>
 
 <body onload='runTest();'>
--- a/dom/canvas/test/test_capture.html
+++ b/dom/canvas/test/test_capture.html
@@ -14,19 +14,19 @@ var vauto;   // Video element with captu
 var vmanual; // Video element with captureStream stream in manual (fps 0) mode.
 var vrate;   // Video element with captureStream stream with fixed frame rate.
 
 function checkDrawColorInitialRed() {
   info("Checking that all video elements become red after first drawColor(red).");
 
   h.drawColor(c, h.red);
 
-  vauto.mozSrcObject = c.captureStream();
-  vmanual.mozSrcObject = c.captureStream(0);
-  vrate.mozSrcObject = c.captureStream(10);
+  vauto.srcObject = c.captureStream();
+  vmanual.srcObject = c.captureStream(0);
+  vrate.srcObject = c.captureStream(10);
 
   ok(h.testPixel(vauto, [0, 0, 0, 0], 0), "vauto hould not be drawn to before stable state");
   ok(h.testPixel(vrate, [0, 0, 0, 0], 0), "vrate Should not be drawn to before stable state");
   ok(h.testPixel(vmanual, [0, 0, 0, 0], 0), "vmanual Should not be drawn to before stable state");
 
   return Promise.resolve()
     .then(() => h.waitForPixel(vauto, h.red, 0, "should become red automatically"))
     .then(() => h.waitForPixel(vrate, h.red, 0, "should become red automatically"))
--- a/dom/canvas/test/webgl-mochitest/test_capture.html
+++ b/dom/canvas/test/webgl-mochitest/test_capture.html
@@ -45,19 +45,19 @@ function checkGLError(info) {
   is("0x" + error.toString(16), "0x0", "WebGL error [" + info + "]");
 }
 
 function checkClearColorInitialRed() {
   info("Checking that clearing to red works for first frame.");
 
   h.clearColor(c, h.red);
 
-  vauto.mozSrcObject = c.captureStream();
-  vmanual.mozSrcObject = c.captureStream(0);
-  vrate.mozSrcObject = c.captureStream(10);
+  vauto.srcObject = c.captureStream();
+  vmanual.srcObject = c.captureStream(0);
+  vrate.srcObject = c.captureStream(10);
 
   ok(h.testPixel(vauto, [0, 0, 0, 0], 0), "Should not be drawn to before stable state");
   ok(h.testPixel(vrate, [0, 0, 0, 0], 0), "Should not be drawn to before stable state");
   ok(h.testPixel(vmanual, [0, 0, 0, 0], 0), "Should not be drawn to before stable state");
 
   return Promise.resolve()
     .then(() => h.waitForPixel(vauto, h.red, 0, "should become red automatically"))
     .then(() => h.waitForPixel(vrate, h.red, 0, "should become red automatically"))
--- a/dom/media/test/manifest.js
+++ b/dom/media/test/manifest.js
@@ -1333,22 +1333,22 @@ function getMajorMimeType(mimetype) {
   } else {
     return "audio";
   }
 }
 
 // Force releasing decoder to avoid timeout in waiting for decoding resource.
 function removeNodeAndSource(n) {
   n.remove();
-  // Clearing mozSrcObject and/or src will actually set them to some default
+  // Clearing srcObject and/or src will actually set them to some default
   // URI that will fail to load, so make sure we don't produce a spurious
   // bailing error.
   n.onerror = null;
-  // reset |mozSrcObject| first since it takes precedence over |src|.
-  n.mozSrcObject = null;
+  // reset |srcObject| first since it takes precedence over |src|.
+  n.srcObject = null;
   n.src = "";
   while (n.firstChild) {
     n.removeChild(n.firstChild);
   }
 }
 
 function once(target, name, cb) {
   var p = new Promise(function(resolve, reject) {
--- a/dom/media/test/test_bug879717.html
+++ b/dom/media/test/test_bug879717.html
@@ -115,16 +115,16 @@ var startTest = function(media, token) {
   v3.onended = onended;
 
   document.body.appendChild(v1);
   document.body.appendChild(v2);
   document.body.appendChild(v3);
 
   v1.src = media.name;
   v2.src = media.name;
-  v3.mozSrcObject = v2.mozCaptureStreamUntilEnded();
+  v3.srcObject = v2.mozCaptureStreamUntilEnded();
 }
 
 manager.runTests(getPlayableVideos(gSmallTests), startTest);
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/test/test_mediarecorder_record_4ch_audiocontext.html
+++ b/dom/media/test/test_mediarecorder_record_4ch_audiocontext.html
@@ -26,17 +26,17 @@ function startTest() {
   var stopTriggered = false;
   var onstopTriggered = false;
   dest.channelCount = 4;
   var expectedMimeType = 'audio/ogg';
   var totalBlobSize = 0;
   source.channelCountMode = 'explicit';
   source.connect(dest);
   var elem = document.createElement('audio');
-  elem.mozSrcObject = dest.stream;
+  elem.srcObject = dest.stream;
   mMediaStream = dest.stream;
   source.start(0);
   elem.play();
   mMediaRecorder = new MediaRecorder(dest.stream);
   mMediaRecorder.onwarning = function() {
     ok(false, 'onwarning unexpectedly fired');
   };
 
--- a/dom/media/test/test_mediarecorder_record_audiocontext.html
+++ b/dom/media/test/test_mediarecorder_record_audiocontext.html
@@ -20,17 +20,17 @@ function startTest() {
 
   var source = context.createBufferSource();
   source.buffer = buffer;
   source.loop = true;
 
   var dest = context.createMediaStreamDestination();
   source.connect(dest);
   var elem = document.createElement('audio');
-  elem.mozSrcObject = dest.stream;
+  elem.srcObject = dest.stream;
   mMediaStream = dest.stream;
   source.start(0);
   elem.play();
   mMediaRecorder = new MediaRecorder(dest.stream);
   mMediaRecorder.onwarning = function() {
     ok(false, 'onwarning unexpectedly fired');
   };
 
--- a/dom/media/test/test_mediatrack_consuming_mediastream.html
+++ b/dom/media/test/test_mediatrack_consuming_mediastream.html
@@ -123,17 +123,17 @@ function startTest() {
           checkTrackChanged(1, false);
         } else if (steps == 3) {
           checkTrackChanged(2, true);
           stream.stop();
         }
       }
 
       var steps = 0;
-      element.mozSrcObject = stream;
+      element.srcObject = stream;
       element.onplaying = onplaying;
       element.onended = onended;
       element.play();
       steps++;
     },
     function(err) {
       ok(false, 'Unexpected error fired with: ' + err);
       SimpleTest.finish();
--- a/dom/media/test/test_multiple_mediastreamtracks.html
+++ b/dom/media/test/test_multiple_mediastreamtracks.html
@@ -16,17 +16,17 @@ function startTest() {
 
     element.onloadedmetadata = function() {
       is(stream.getAudioTracks().length, 4, 'Length of audio tracks should be 4.');
       is(stream.getVideoTracks().length, 3, 'Length of vudio tracks should be 3.');
       SimpleTest.finish();
     };
 
     mStream = stream;
-    element.mozSrcObject = mStream;
+    element.srcObject = mStream;
     element.play();
   })
   .catch(function(reason) {
     ok(false, "unexpected error = " + reason.message);
     SimpleTest.finish();
   });
 }
 
--- a/dom/media/test/test_streams_autoplay.html
+++ b/dom/media/test/test_streams_autoplay.html
@@ -15,17 +15,17 @@ SimpleTest.waitForExplicitFinish();
 
 var media = getPlayableVideo(gSmallTests);
 
 if (media == null) {
   todo(false, "No media supported.");
   SimpleTest.finish();
 } else {
   v1.src = media.name;
-  v2.mozSrcObject = v1.mozCaptureStream();
+  v2.srcObject = v1.mozCaptureStream();
   var onPlayingEventFired = false;
 
   v2.onplaying = function() {
     if(!onPlayingEventFired) {
       onPlayingEventFired = true;
       ok(true, "playback started");
       SimpleTest.finish();
     }
--- a/dom/media/test/test_streams_element_capture.html
+++ b/dom/media/test/test_streams_element_capture.html
@@ -33,18 +33,18 @@ function startTest(test, token) {
   var vout = document.createElement('video');
   vout.token = token;
   v.name = token + "(v)";
   vout.name = token + "(vout)";
 
   v.src = test.name;
   var stream = v.mozCaptureStreamUntilEnded();
   is(stream.currentTime, 0, test.name + " stream initial currentTime");
-  vout.mozSrcObject = stream;
-  is(vout.mozSrcObject, stream, test.name + " set output element .srcObject correctly");
+  vout.srcObject = stream;
+  is(vout.srcObject, stream, test.name + " set output element .srcObject correctly");
 
   var checkEnded = function(test, vout, stream) { return function() {
     is(stream.currentTime, vout.currentTime, test.name + " stream final currentTime");
     if (test.duration) {
       ok(Math.abs(vout.currentTime - test.duration) < 0.1,
          test.name + " current time at end: " + vout.currentTime + " should be: " + test.duration);
     }
     is(vout.readyState, vout.HAVE_CURRENT_DATA, test.name + " checking readyState");
--- a/dom/media/test/test_streams_element_capture_reset.html
+++ b/dom/media/test/test_streams_element_capture_reset.html
@@ -12,18 +12,18 @@
 <video id="vout_untilended"></video>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 SimpleTest.waitForExplicitFinish();
 
 var v = document.getElementById('v');
 var vout = document.getElementById('vout');
 var vout_untilended = document.getElementById('vout_untilended');
-vout.mozSrcObject = v.mozCaptureStream();
-vout_untilended.mozSrcObject = v.mozCaptureStreamUntilEnded();
+vout.srcObject = v.mozCaptureStream();
+vout_untilended.srcObject = v.mozCaptureStreamUntilEnded();
 
 function dumpEvent(event) {
   var v = event.target;
   info(v.name + " GOT EVENT " + event.type +
        " currentTime=" + v.currentTime +
        " paused=" + v.paused +
        " ended=" + v.ended +
        " readyState=" + v.readyState);
--- a/dom/media/test/test_streams_srcObject.html
+++ b/dom/media/test/test_streams_srcObject.html
@@ -1,54 +1,62 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Test interactions of src and srcObject</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
   <script type="text/javascript" src="manifest.js"></script>
 </head>
-<body onload="doTest()">
-<audio id="a"></audio>
+<body onload="doTests()">
+<audio id="a1"></audio>
+<audio id="a2"></audio>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 SimpleTest.waitForExplicitFinish();
 
-var a = document.getElementById('a');
-a.src = getPlayableAudio(gSmallTests).name;
+var doTest = srcObject => new Promise(resolve => {
+  var a = document.getElementById('a1');
+  a.src = getPlayableAudio(gSmallTests).name;
+  var b = new Audio();
 
-var b = new Audio();
-
-function doTest() {
   var newSrc = a.src + "?2";
   b.src = newSrc;
-  is(b.mozSrcObject, null, "Initial srcObject is null");
+  is(b[srcObject], null, "Initial srcObject is null");
   var stream = a.mozCaptureStream();
-  b.mozSrcObject = stream;
-  is(b.mozSrcObject, stream, "Stream set correctly");
+  b[srcObject] = stream;
+  is(b[srcObject], stream, "Stream set correctly");
   try {
-    b.mozSrcObject = "invalid";
-    ok(false, "Setting mozSrcObject to an invalid value should throw.");
+    b[srcObject] = "invalid";
+    ok(false, "Setting srcObject to an invalid value should throw.");
   } catch (e) {
     ok(e instanceof TypeError, "Exception should be a TypeError");
   }
-  is(b.mozSrcObject, stream, "Stream not set to invalid value");
+  is(b[srcObject], stream, "Stream not set to invalid value");
   is(b.src, newSrc, "src attribute not affected by setting srcObject");
   var step = 0;
   b.addEventListener("loadedmetadata", function() {
     if (step == 0) {
       is(b.currentSrc, "", "currentSrc set to empty string while playing srcObject");
-      b.mozSrcObject = null;
-      is(b.mozSrcObject, null, "Stream set to null");
+      b[srcObject] = null;
+      is(b[srcObject], null, "Stream set to null");
       // The resource selection algorithm will run again and choose b.src
     } else if (step == 1) {
       is(b.currentSrc, b.src, "currentSrc set to src now that srcObject is null");
-      SimpleTest.finish();
+      resolve();
     }
     ++step;
   });
   a.play();
   b.play();
-}
+});
+
+// TODO: remove prefixed version soon (1183495).
+
+var doTests = () => doTest("srcObject").then(() => doTest("mozSrcObject"))
+  .catch(e => ok(false, "Unexpected error: " + e))
+  .then(() => SimpleTest.finish())
+  .catch(e => ok(false, "Coding error: " + e));
+
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/tests/mochitest/blacksilence.js
+++ b/dom/media/tests/mochitest/blacksilence.js
@@ -60,17 +60,17 @@
         silence = false;
       }
     }
     return silence;
   }
 
   function checkAudio(constraintApplied, stream) {
     var audio = mkElement('audio');
-    audio.mozSrcObject = stream;
+    audio.srcObject = stream;
     audio.play();
 
     var context = new AudioContext();
     var source = context.createMediaStreamSource(stream);
     var analyser = context.createAnalyser();
     source.connect(analyser);
     analyser.connect(context.destination);
 
@@ -88,17 +88,17 @@
       analyser.disconnect();
       audio.pause();
       ok(true, 'audio is ' + (constraintApplied ? '' : 'not ') + 'silent');
     });
   }
 
   function checkVideo(constraintApplied, stream) {
     var video = mkElement('video');
-    video.mozSrcObject = stream;
+    video.srcObject = stream;
     video.play();
 
     return periodicCheck(() => {
       try {
         var canvas = mkElement('canvas');
         var ctx = canvas.getContext('2d');
         // Have to guard drawImage with the try as well, due to bug 879717. If
         // we get an error, this round fails, but that failure is usually just
--- a/dom/media/tests/mochitest/mediaStreamPlayback.js
+++ b/dom/media/tests/mochitest/mediaStreamPlayback.js
@@ -117,17 +117,17 @@ MediaStreamPlayback.prototype = {
       };
 
       // Adds a listener intended to be fired when playback is available
       // without further buffering.
       this.mediaElement.addEventListener('canplaythrough', canPlayThroughCallback,
                                          false);
 
       // Hooks up the media stream to the media element and starts playing it
-      this.mediaElement.mozSrcObject = this.mediaStream;
+      this.mediaElement.srcObject = this.mediaStream;
       this.mediaElement.play();
 
       // If canplaythrough doesn't fire in enough time, we fail the test
       setTimeout(() => {
         this.mediaElement.removeEventListener('canplaythrough',
                                               canPlayThroughCallback, false);
         reject(new Error("canplaythrough event never fired"));
       }, CANPLAYTHROUGH_TIMEOUT_LENGTH);
@@ -137,17 +137,17 @@ MediaStreamPlayback.prototype = {
   /**
    * Stops the media with the associated stream.
    *
    * Precondition: The media stream and element should both be actively
    *               being played.
    */
   stopMediaElement : function() {
     this.mediaElement.pause();
-    this.mediaElement.mozSrcObject = null;
+    this.mediaElement.srcObject = null;
   }
 }
 
 
 /**
  * This class is basically the same as MediaStreamPlayback except
  * ensures that the instance provided startMedia is a MediaStream.
  *
--- a/dom/media/tests/mochitest/pc.js
+++ b/dom/media/tests/mochitest/pc.js
@@ -808,17 +808,17 @@ PeerConnectionWrapper.prototype = {
             type: track.kind,
             streamId: stream.id
           };
       });
     }
 
     var element = createMediaElement(type, this.label + '_' + side + this.streams.length);
     this.mediaElements.push(element);
-    element.mozSrcObject = stream;
+    element.srcObject = stream;
     element.play();
 
     // Store local media elements so that we can stop them when done.
     // Don't store remote ones because they should stop when the PC does.
     if (side === 'local') {
       this.localMediaElements.push(element);
       return this.observedNegotiationNeeded;
     }
--- a/dom/media/tests/mochitest/test_getUserMedia_basicVideo_playAfterLoadedmetadata.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_basicVideo_playAfterLoadedmetadata.html
@@ -19,17 +19,17 @@
     var constraints = {video: true};
 
     return getUserMedia(constraints).then(stream => {
       checkMediaStreamTracks(constraints, stream);
 
       var playback = new LocalMediaStreamPlayback(testVideo, stream);
       var video = playback.mediaElement;
 
-      video.mozSrcObject = stream;
+      video.srcObject = stream;
       return new Promise(resolve => {
         ok(playback.mediaElement.paused,
            "Media element should be paused before play()ing");
         video.addEventListener('loadedmetadata', function() {
           ok(video.videoWidth > 0, "Expected nonzero video width");
           ok(video.videoHeight > 0, "Expected nonzero video width");
           resolve();
         });
--- a/dom/media/tests/mochitest/test_peerConnection_promiseSendOnly.html
+++ b/dom/media/tests/mochitest/test_peerConnection_promiseSendOnly.html
@@ -1,9 +1,9 @@
-<!DOCTYPE HTML>
+<!DOCTYPE HTML>
 <html>
 <head>
   <script type="application/javascript" src="pc.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript;version=1.8">
   createHTML({
@@ -22,36 +22,36 @@
 
   pc1.onicecandidate = e => pc2_haveRemoteOffer.then(() => !e.candidate ||
     pc2.addIceCandidate(e.candidate)).catch(generateErrorCallback());
   pc2.onicecandidate = e => pc1_stable.then(() => !e.candidate ||
     pc1.addIceCandidate(e.candidate)).catch(generateErrorCallback());
 
   var v1, v2;
   var delivered = new Promise(resolve =>
-    pc2.onaddstream = e => resolve(v2.mozSrcObject = e.stream));
+    pc2.onaddstream = e => resolve(v2.srcObject = e.stream));
 
   runNetworkTest(function() {
     v1 = createMediaElement('video', 'v1');
     v2 = createMediaElement('video', 'v2');
     var canPlayThrough = new Promise(resolve => v2.canplaythrough = e => resolve());
 
     is(v2.currentTime, 0, "v2.currentTime is zero at outset");
 
     navigator.mediaDevices.getUserMedia({ fake: true, video: true, audio: true })
-    .then(stream => pc1.addStream(v1.mozSrcObject = stream))
+    .then(stream => pc1.addStream(v1.srcObject = stream))
     .then(() => pc1.createOffer({})) // check that createOffer accepts arg.
     .then(offer => pc1.setLocalDescription(offer))
     .then(() => pc2.setRemoteDescription(pc1.localDescription))
     .then(() => pc2.createAnswer({}))  // check that createAnswer accepts arg.
     .then(answer => pc2.setLocalDescription(answer))
     .then(() => pc1.setRemoteDescription(pc2.localDescription))
     .then(() => delivered)
 //    .then(() => canPlayThrough)    // why doesn't this fire?
-    .then(() => waitUntil(() => v2.currentTime > 0 && v2.mozSrcObject.currentTime > 0))
+    .then(() => waitUntil(() => v2.currentTime > 0 && v2.srcObject.currentTime > 0))
     .then(() => ok(v2.currentTime > 0, "v2.currentTime is moving (" + v2.currentTime + ")"))
     .then(() => ok(true, "Connected."))
     .catch(reason => ok(false, "unexpected failure: " + reason))
     .then(networkTestFinished);
   });
 </script>
 </pre>
 </body>
--- a/dom/media/webaudio/test/test_mediaStreamAudioDestinationNode.html
+++ b/dom/media/webaudio/test/test_mediaStreamAudioDestinationNode.html
@@ -22,17 +22,17 @@ addLoadEvent(function() {
 
   var source = context.createBufferSource();
   source.buffer = buffer;
 
   var dest = context.createMediaStreamDestination();
   source.connect(dest);
 
   var elem = document.getElementById('audioelem');
-  elem.mozSrcObject = dest.stream;
+  elem.srcObject = dest.stream;
   elem.onloadedmetadata = function() {
     ok(true, "got metadata event");
     setTimeout(function() {
       is(elem.played.length, 1, "should have a played interval");
       is(elem.played.start(0), 0, "should have played immediately");
       isnot(elem.played.end(0), 0, "should have played for a non-zero interval");
       SimpleTest.finish();
     }, 2000);
--- a/mobile/android/tests/browser/robocop/robocop_getusermedia.html
+++ b/mobile/android/tests/browser/robocop/robocop_getusermedia.html
@@ -30,55 +30,55 @@
       },
       audio: true
     };
     startMedia(mediaConstraints);
   }
 
   function stopMedia() {
     if (video_status) {
-      video.mozSrcObject.stop();
-      video.mozSrcObject = null;
+      video.srcObject.stop();
+      video.srcObject = null;
       content.removeChild(video);
       capturing = false;
       video_status = false;
     }
     if (audio_status) {
-      audio.mozSrcObject.stop();
-      audio.mozSrcObject = null;
+      audio.srcObject.stop();
+      audio.srcObject = null;
       content.removeChild(audio);
       audio_status = false;
     }
   }
 
   function startMedia(param) {
     try {
       window.navigator.mozGetUserMedia(param, function(stream) {
         if (video_status) {
           content.appendChild(video);
-          video.mozSrcObject = stream;
+          video.srcObject = stream;
           video.play();
         }
         if (audio_status) {
           content.appendChild(audio);
-          audio.mozSrcObject = stream;
+          audio.srcObject = stream;
           audio.play();
         }
         var audioTracks = stream.getAudioTracks();
         var videoTracks = stream.getVideoTracks();
         document.title = "";
         if (audioTracks.length > 0) {
           document.title += "audio";
         }
         if (videoTracks.length > 0) {
           document.title += "video";
         }
         document.title += " gumtest";
-        audio.mozSrcObject.stop();
-        video.mozSrcObject.stop();
+        audio.srcObject.stop();
+        video.srcObject.stop();
       }, function(err) {
         document.title = "failed gumtest";
         stopMedia();
       });
     } catch(e) {
       stopMedia();
     }
   }