Bug 1183495 - part3: Remove mozSrcObject usage. r=jwwang
MozReview-Commit-ID: Gtpne3O0pBQ
--- a/dom/media/test/crashtests/1028458.html
+++ b/dom/media/test/crashtests/1028458.html
@@ -6,17 +6,17 @@ navigator.mozGetUserMedia({audio: true,
var testAudio = document.getElementById('testAudio');
// Wait some time for good measure
var eventReceived = 0;
testAudio.addEventListener("timeupdate", function() {
if (++eventReceived == 3) {
document.querySelector("html").className = "";
}
})
- testAudio.mozSrcObject = stream;
+ testAudio.srcObject = stream;
testAudio.play();
}, function(err) {
// Don't go orange if we can't get an audio input stream,
// as this is not what we are trying to test and can happen on Windows.
document.querySelector("html").className = "";
});
</script>
--- a/dom/media/test/test_mediatrack_events.html
+++ b/dom/media/test/test_mediatrack_events.html
@@ -101,17 +101,17 @@ function startTest() {
element.onpause = onpause;
element.pause();
} else if (steps == 2) {
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_streams_srcObject.html
+++ b/dom/media/test/test_streams_srcObject.html
@@ -44,19 +44,17 @@ var doTest = srcObject => new Promise(re
resolve();
}
++step;
});
a.play();
b.play();
});
-// TODO: remove prefixed version soon (1183495).
-
-var doTests = () => doTest("srcObject").then(() => doTest("mozSrcObject"))
+var doTests = () => doTest("srcObject")
.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/test_getUserMedia_audioCapture.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_audioCapture.html
@@ -64,17 +64,17 @@ scriptsReady
oscThroughMediaElement.frequency.value = 1000;
var oscThroughAudioDestinationNode = ac.createOscillator();
oscThroughAudioDestinationNode.frequency.value = 5000;
var msDest = ac.createMediaStreamDestination();
oscThroughMediaElement.connect(msDest);
oscThroughAudioDestinationNode.connect(ac.destination);
- acTone.mozSrcObject = msDest.stream;
+ acTone.srcObject = msDest.stream;
getSineWaveFile(10000, 10, function(blob) {
wavtone.src = URL.createObjectURL(blob);
oscThroughMediaElement.start();
oscThroughAudioDestinationNode.start();
wavtone.loop = true;
wavtone.play();
acTone.play();
--- a/dom/media/tests/mochitest/test_peerConnection_callbacks.html
+++ b/dom/media/tests/mochitest/test_peerConnection_callbacks.html
@@ -48,39 +48,39 @@ pc2.onicecandidate = e => {
pc1_stable
.then(() => !e.candidate || pcall(pc1, pc1.addIceCandidate, e.candidate))
.catch(generateErrorCallback());
};
var v1, v2;
var delivered = new Promise(resolve => {
pc2.onaddstream = e => {
- v2.mozSrcObject = e.stream;
+ v2.srcObject = e.stream;
resolve(e.stream);
};
});
runNetworkTest(function() {
v1 = createMediaElement('video', 'v1');
v2 = createMediaElement('video', 'v2');
var canPlayThrough = new Promise(resolve => v2.canplaythrough = resolve);
is(v2.currentTime, 0, "v2.currentTime is zero at outset");
// not testing legacy gUM here
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
- .then(stream => pc1.addStream(v1.mozSrcObject = stream))
+ .then(stream => pc1.addStream(v1.srcObject = stream))
.then(() => pcall(pc1, pc1.createOffer))
.then(offer => pcall(pc1, pc1.setLocalDescription, offer))
.then(() => pcall(pc2, pc2.setRemoteDescription, pc1.localDescription))
.then(() => pcall(pc2, pc2.createAnswer))
.then(answer => pcall(pc2, pc2.setLocalDescription, answer))
.then(() => pcall(pc1, 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."))
.then(() => pcall(pc1, pc1.getStats, null))
.then(stats => ok(Object.keys(stats).length > 0, "pc1 has stats"))
.then(() => pcall(pc2, pc2.getStats, null))
.then(stats => ok(Object.keys(stats).length > 0, "pc2 has stats"))
.then(() => { v1.pause(); v2.pause(); })
.catch(reason => ok(false, "unexpected failure: " + reason))
--- a/media/webrtc/trunk/webrtc/tools/loopback_test/adapter.js
+++ b/media/webrtc/trunk/webrtc/tools/loopback_test/adapter.js
@@ -105,23 +105,23 @@ if (navigator.mozGetUserMedia) {
}
}
return iceServers;
}
// Attach a media stream to an element.
attachMediaStream = function(element, stream) {
console.log("Attaching media stream");
- element.mozSrcObject = stream;
+ element.srcObject = stream;
element.play();
};
reattachMediaStream = function(to, from) {
console.log("Reattaching media stream");
- to.mozSrcObject = from.mozSrcObject;
+ to.srcObject = from.srcObject;
to.play();
};
// Fake get{Video,Audio}Tracks
if (!MediaStream.prototype.getVideoTracks) {
MediaStream.prototype.getVideoTracks = function() {
return [];
};
@@ -189,18 +189,16 @@ if (navigator.mozGetUserMedia) {
// Code from Adam Barth.
getUserMedia = navigator.webkitGetUserMedia.bind(navigator);
navigator.getUserMedia = getUserMedia;
// Attach a media stream to an element.
attachMediaStream = function(element, stream) {
if (typeof element.srcObject !== 'undefined') {
element.srcObject = stream;
- } else if (typeof element.mozSrcObject !== 'undefined') {
- element.mozSrcObject = stream;
} else if (typeof element.src !== 'undefined') {
element.src = URL.createObjectURL(stream);
} else {
console.log('Error attaching stream to element.');
}
};
reattachMediaStream = function(to, from) {
--- a/mobile/android/tests/browser/robocop/robocop_getusermedia2.html
+++ b/mobile/android/tests/browser/robocop/robocop_getusermedia2.html
@@ -27,55 +27,55 @@
video: true,
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();
}
}