Bug 1155923 - Removing moz prefix from RTC interfaces, r=jesup,smaug

--HG--
extra : transplant_source : %0Adu%1E%A6j%9E%C2B%25%ECruo%F7%7Fc%EA%99%18
This commit is contained in:
Martin Thomson 2015-09-28 11:25:04 -07:00
parent dacd5751f3
commit afdaddf1d7
55 changed files with 176 additions and 152 deletions

View File

@ -19,7 +19,8 @@
"chai": false,
"console": false,
"loop": true,
"mozRTCSessionDescription": false,
"MozActivity": false,
"RTCSessionDescription": false,
"OT": false,
"performance": false,
"Promise": false,

View File

@ -1000,7 +1000,7 @@ var MozLoopServiceInternal = {
}
};
let pc_static = new window.mozRTCPeerConnectionStatic();
let pc_static = new window.RTCPeerConnectionStatic();
pc_static.registerPeerConnectionLifecycleCallback(onPCLifecycleChange);
UITour.notify("Loop:ChatWindowOpened");

View File

@ -17,11 +17,11 @@ describe("Validator", function() {
function Y(){}
describe("#validate", function() {
function mozRTCSessionDescription() {}
var mozRTC;
function RTCSessionDescription() {}
var rtcsd;
beforeEach(function() {
mozRTC = new mozRTCSessionDescription();
rtcsd = new RTCSessionDescription();
});
it("should check for a single required dependency when no option passed",
@ -74,9 +74,9 @@ describe("Validator", function() {
});
it("should check for a native constructor dependency", function() {
expect(create({foo: mozRTC}, {foo: "x"}))
expect(create({foo: rtcsd}, {foo: "x"}))
.to.Throw(TypeError,
/invalid dependency: foo; expected mozRTCSessionDescription/);
/invalid dependency: foo; expected RTCSessionDescription/);
});
it("should check for a null dependency", function() {

View File

@ -11,7 +11,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=923010
<script type="application/javascript">
/** Test for Bug 923010 **/
try {
var conn = new mozRTCPeerConnection();
var conn = new RTCPeerConnection();
try {
conn.updateIce(candidate, function() {
ok(false, "The call to updateIce succeeded when it should have thrown");
@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=923010
"Should have the exception we expect");
}
var candidate = new mozRTCIceCandidate({candidate: null });
var candidate = new RTCIceCandidate({candidate: null });
conn.addIceCandidate(candidate)
.then(function() {

View File

@ -233,7 +233,7 @@ function RTCIceCandidate() {
this.candidate = this.sdpMid = this.sdpMLineIndex = null;
}
RTCIceCandidate.prototype = {
classDescription: "mozRTCIceCandidate",
classDescription: "RTCIceCandidate",
classID: PC_ICE_CID,
contractID: PC_ICE_CONTRACT,
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
@ -252,7 +252,7 @@ function RTCSessionDescription() {
this.type = this.sdp = null;
}
RTCSessionDescription.prototype = {
classDescription: "mozRTCSessionDescription",
classDescription: "RTCSessionDescription",
classID: PC_SESSION_CID,
contractID: PC_SESSION_CONTRACT,
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
@ -346,7 +346,7 @@ function RTCPeerConnection() {
this._iceGatheringState = this._iceConnectionState = "new";
}
RTCPeerConnection.prototype = {
classDescription: "mozRTCPeerConnection",
classDescription: "RTCPeerConnection",
classID: PC_CID,
contractID: PC_CONTRACT,
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
@ -458,7 +458,7 @@ RTCPeerConnection.prototype = {
}
certPromise = Promise.resolve(cert);
} else {
certPromise = this._win.mozRTCPeerConnection.generateCertificate({
certPromise = this._win.RTCPeerConnection.generateCertificate({
name: "ECDSA", namedCurve: "P-256"
});
}
@ -733,7 +733,7 @@ RTCPeerConnection.prototype = {
}));
p = this._addIdentityAssertion(p, origin);
return p.then(
sdp => new this._win.mozRTCSessionDescription({ type: "offer", sdp: sdp }));
sdp => new this._win.RTCSessionDescription({ type: "offer", sdp: sdp }));
});
});
},
@ -768,7 +768,7 @@ RTCPeerConnection.prototype = {
}));
p = this._addIdentityAssertion(p, origin);
return p.then(sdp => {
return new this._win.mozRTCSessionDescription({ type: "answer", sdp: sdp });
return new this._win.RTCSessionDescription({ type: "answer", sdp: sdp });
});
});
});
@ -1069,7 +1069,7 @@ RTCPeerConnection.prototype = {
}
sdp = this._localIdp.addIdentityAttribute(sdp);
return new this._win.mozRTCSessionDescription({ type: this._localType,
return new this._win.RTCSessionDescription({ type: this._localType,
sdp: sdp });
},
@ -1079,7 +1079,7 @@ RTCPeerConnection.prototype = {
if (sdp.length == 0) {
return null;
}
return new this._win.mozRTCSessionDescription({ type: this._remoteType,
return new this._win.RTCSessionDescription({ type: this._remoteType,
sdp: sdp });
},
@ -1268,7 +1268,7 @@ PeerConnectionObserver.prototype = {
if (candidate == "") {
this.foundIceCandidate(null);
} else {
this.foundIceCandidate(new this._dompc._win.mozRTCIceCandidate(
this.foundIceCandidate(new this._dompc._win.RTCIceCandidate(
{
candidate: candidate,
sdpMid: mid,
@ -1447,7 +1447,7 @@ PeerConnectionObserver.prototype = {
function RTCPeerConnectionStatic() {
}
RTCPeerConnectionStatic.prototype = {
classDescription: "mozRTCPeerConnectionStatic",
classDescription: "RTCPeerConnectionStatic",
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
Ci.nsIDOMGlobalPropertyInitializer]),

View File

@ -7,7 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=791270
<meta charset="utf-8">
<title>Simple PeerConnection Video Test</title>
<script type="application/javascript">
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
pc.addStream(undefined);
</script>
</head>

View File

@ -7,10 +7,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=791278
<meta charset="utf-8">
<title>Simple PeerConnection Video Test - Invalid callback</title>
<script type="application/javascript">
var pc1 = new mozRTCPeerConnection();
var pc1 = new RTCPeerConnection();
pc1.setLocalDescription(function() {});
var pc2 = new mozRTCPeerConnection();
var pc2 = new RTCPeerConnection();
pc2.setRemoteDescription(function() {});
</script>
</head>

View File

@ -12,7 +12,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=791330
}
function runTest() {
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
pc.close();
navigator.mozGetUserMedia({audio: true, fake: true}, function (stream) {

View File

@ -12,8 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=799419
}
function boom() {
var v0 = new mozRTCPeerConnection();
var v1 = new mozRTCPeerConnection();
var v0 = new RTCPeerConnection();
var v1 = new RTCPeerConnection();
var v2 = document.getElementById("pc1video");
var v3 = document.getElementById("pc2video");
navigator.mozGetUserMedia({video:true, fake: true},

View File

@ -7,7 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=801227
<meta charset="utf-8">
<title>Abort due to page reload</title>
<script type="application/javascript">
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
var index = localStorage.index || 0;
if (index < 3) {

View File

@ -33,8 +33,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=812785
var stream = localAudio.mozCaptureStreamUntilEnded();
pc1 = new mozRTCPeerConnection();
pc2 = new mozRTCPeerConnection();
pc1 = new RTCPeerConnection();
pc2 = new RTCPeerConnection();
pc1.addStream(stream);
pc1.createOffer(function (offer) {

View File

@ -15,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822197
function start() {
for(var i = 0; i < 70; i++) {
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
pc.createOffer(function() {}, function() {});
pcArray.push(pc);
}

View File

@ -3,8 +3,8 @@
<script language="javascript">
function start() {
remotePC = new mozRTCPeerConnection();
var cand = new mozRTCIceCandidate(
remotePC = new RTCPeerConnection();
var cand = new RTCIceCandidate(
{candidate: "1 1 UDP 1 127.0.0.1 34567 type host",
sdpMid: "helloworld",
sdbMid: "helloworld", // Mis-spelt attribute for bug 833948 compatibility.

View File

@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=836349
<script type="application/javascript">
function crash()
{
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
var ld = pc.localDescription;
dump(ld.sdp);
}

View File

@ -12,8 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=837324
}
function start() {
var o0 = new mozRTCPeerConnection();
var o1 = new mozRTCIceCandidate({"candidate":"0 -65535 IP 0 stun.sipgate.net 3227326073 type ::ffff:192.0.2.128 host 2302600701","sdpMid":"video 3907077665 RTP/SAVPF 5000","sdpMLineIndex":7});
var o0 = new RTCPeerConnection();
var o1 = new RTCIceCandidate({"candidate":"0 -65535 IP 0 stun.sipgate.net 3227326073 type ::ffff:192.0.2.128 host 2302600701","sdpMid":"video 3907077665 RTP/SAVPF 5000","sdpMLineIndex":7});
try {o0.addIceCandidate(o1);} catch(e) {} // bug 842075 - remove try when fixed
finish();

View File

@ -49,8 +49,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=855796
}
function start() {
pc1 = new mozRTCPeerConnection();
pc2 = new mozRTCPeerConnection();
pc1 = new RTCPeerConnection();
pc2 = new RTCPeerConnection();
navigator.mozGetUserMedia({audio:true, video:true, fake:true}, function(s) {
pc1.addStream(s);
navigator.mozGetUserMedia({audio:true, video:true, fake:true}, function(s) {

View File

@ -8,7 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=860143
<title>bug 860143</title>
<script type="application/javascript">
function start() {
var o0 = new window.mozRTCPeerConnection({
var o0 = new window.RTCPeerConnection({
iceServers: [
{
url: "turn:AAAAAAAAAAAAAAAAA AAAAAAAAAAA AAAAAAAAAAAAA AA AAAAA AAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAA AAAAAAAAAA, AAAAAAAAAAAAAAAA AAA AAAAAAAAAAAAAAA"

View File

@ -8,7 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=861958
<title>bug 861958</title>
<script type="application/javascript">
function start() {
var o0 = new window.mozRTCPeerConnection();
var o0 = new window.RTCPeerConnection();
var o1 = o0.createDataChannel("foo", {
"protocol": "text/char",
"preset": false,

View File

@ -49,8 +49,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=863929
}
function start() {
pc1 = new mozRTCPeerConnection();
pc2 = new mozRTCPeerConnection();
pc1 = new RTCPeerConnection();
pc2 = new RTCPeerConnection();
navigator.mozGetUserMedia({audio:true, video:true, fake:true}, function(s) {
pc1.addStream(s);
navigator.mozGetUserMedia({audio:true, video:true, fake:true}, function(s) {

View File

@ -51,9 +51,9 @@ function fingerprintSdp(fingerprints) {
// This function synthesizes that SDP and tries to set it.
function testMultipleFingerprints() {
// this one fails setRemoteDescription if the identity is not good
var pcStrict = new mozRTCPeerConnection({ peerIdentity: 'someone@example.com'});
var pcStrict = new RTCPeerConnection({ peerIdentity: 'someone@example.com'});
// this one will be manually tweaked to have two fingerprints
var pcDouble = new mozRTCPeerConnection({});
var pcDouble = new RTCPeerConnection({});
var offer, match, fingerprints;
@ -86,7 +86,7 @@ function testMultipleFingerprints() {
fingerprintSdp(fingerprints.slice(1)) +
offer.sdp.slice(match.index);
var desc = new mozRTCSessionDescription({ type: 'offer', sdp: sdp });
var desc = new RTCSessionDescription({ type: 'offer', sdp: sdp });
return pcStrict.setRemoteDescription(desc);
})
.then(() => {

View File

@ -281,7 +281,7 @@ PeerConnectionTest.prototype.createDataChannel = function(options) {
PeerConnectionTest.prototype.createAnswer = function(peer) {
return peer.createAnswer().then(answer => {
// make a copy so this does not get updated with ICE candidates
this.originalAnswer = new mozRTCSessionDescription(JSON.parse(JSON.stringify(answer)));
this.originalAnswer = new RTCSessionDescription(JSON.parse(JSON.stringify(answer)));
return answer;
});
};
@ -296,7 +296,7 @@ PeerConnectionTest.prototype.createAnswer = function(peer) {
PeerConnectionTest.prototype.createOffer = function(peer) {
return peer.createOffer().then(offer => {
// make a copy so this does not get updated with ICE candidates
this.originalOffer = new mozRTCSessionDescription(JSON.parse(JSON.stringify(offer)));
this.originalOffer = new RTCSessionDescription(JSON.parse(JSON.stringify(offer)));
return offer;
});
};
@ -307,7 +307,7 @@ PeerConnectionTest.prototype.createOffer = function(peer) {
*
* @param {PeerConnectionWrapper} peer
The peer connection wrapper to run the command on
* @param {mozRTCSessionDescription} desc
* @param {RTCSessionDescription} desc
* Session description for the local description request
*/
PeerConnectionTest.prototype.setLocalDescription =
@ -376,7 +376,7 @@ PeerConnectionTest.prototype.setOfferOptions = function(options) {
*
* @param {PeerConnectionWrapper} peer
The peer connection wrapper to run the command on
* @param {mozRTCSessionDescription} desc
* @param {RTCSessionDescription} desc
* Session description for the remote description request
*/
PeerConnectionTest.prototype.setRemoteDescription =
@ -730,7 +730,7 @@ function PeerConnectionWrapper(label, configuration) {
this.iceCheckingRestartExpected = false;
info("Creating " + this);
this._pc = new mozRTCPeerConnection(this.configuration);
this._pc = new RTCPeerConnection(this.configuration);
/**
* Setup callback handlers
@ -984,7 +984,7 @@ PeerConnectionWrapper.prototype = {
* Sets the local description and automatically handles the failure case.
*
* @param {object} desc
* mozRTCSessionDescription for the local description request
* RTCSessionDescription for the local description request
*/
setLocalDescription : function(desc) {
this.observedNegotiationNeeded = undefined;
@ -998,7 +998,7 @@ PeerConnectionWrapper.prototype = {
* causes the test case to fail if the call succeeds.
*
* @param {object} desc
* mozRTCSessionDescription for the local description request
* RTCSessionDescription for the local description request
* @returns {Promise}
* A promise that resolves to the expected error
*/
@ -1015,7 +1015,7 @@ PeerConnectionWrapper.prototype = {
* Sets the remote description and automatically handles the failure case.
*
* @param {object} desc
* mozRTCSessionDescription for the remote description request
* RTCSessionDescription for the remote description request
*/
setRemoteDescription : function(desc) {
this.observedNegotiationNeeded = undefined;
@ -1035,7 +1035,7 @@ PeerConnectionWrapper.prototype = {
* causes the test case to fail if the call succeeds.
*
* @param {object} desc
* mozRTCSessionDescription for the remote description request
* RTCSessionDescription for the remote description request
* @returns {Promise}
* a promise that resolve to the returned error
*/
@ -1136,7 +1136,7 @@ PeerConnectionWrapper.prototype = {
* later, depending on the state of the PeerConnection.
*
* @param {object} candidate
* The mozRTCIceCandidate to be added or stored
* The RTCIceCandidate to be added or stored
*/
storeOrAddIceCandidate : function(candidate) {
this._remote_ice_candidates.push(candidate);

View File

@ -141,7 +141,7 @@ var commandsPeerConnectionInitial = [
test.setupSignalingClient();
test.registerSignalingCallback("ice_candidate", function (message) {
var pc = test.pcRemote ? test.pcRemote : test.pcLocal;
pc.storeOrAddIceCandidate(new mozRTCIceCandidate(message.ice_candidate));
pc.storeOrAddIceCandidate(new RTCIceCandidate(message.ice_candidate));
});
test.registerSignalingCallback("end_of_trickle_ice", function (message) {
test.signalingMessagesFinished();
@ -291,7 +291,7 @@ var commandsPeerConnectionOfferAnswer = [
return test.getSignalingMessage("offer")
.then(message => {
ok("offer" in message, "Got an offer message");
test._local_offer = new mozRTCSessionDescription(message.offer);
test._local_offer = new RTCSessionDescription(message.offer);
test._offer_constraints = message.offer_constraints;
test._offer_options = message.offer_options;
});
@ -351,7 +351,7 @@ var commandsPeerConnectionOfferAnswer = [
return test.getSignalingMessage("answer").then(message => {
ok("answer" in message, "Got an answer message");
test._remote_answer = new mozRTCSessionDescription(message.answer);
test._remote_answer = new RTCSessionDescription(message.answer);
test._answer_constraints = message.answer_constraints;
});
},

View File

@ -12,7 +12,7 @@
});
runNetworkTest(function () {
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
// necessary to circumvent bug 864109
var options = { offerToReceiveAudio: true };

View File

@ -19,7 +19,7 @@
test.chain.insertAfter("PC_LOCAL_SET_LOCAL_DESCRIPTION", [
function PC_LOCAL_ADD_CANDIDATE_EARLY(test) {
var candidate = new mozRTCIceCandidate(
var candidate = new RTCIceCandidate(
{candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host",
sdpMLineIndex: 0});
return test.pcLocal._pc.addIceCandidate(candidate).then(
@ -31,7 +31,7 @@
]);
test.chain.insertAfter("PC_REMOTE_SET_LOCAL_DESCRIPTION", [
function PC_REMOTE_ADD_CANDIDATE_INVALID_INDEX(test) {
var invalid_index = new mozRTCIceCandidate(
var invalid_index = new RTCIceCandidate(
{candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host",
sdpMLineIndex: 2});
return test.pcRemote._pc.addIceCandidate(invalid_index)
@ -43,7 +43,7 @@
);
},
function PC_REMOTE_ADD_BOGUS_CANDIDATE(test) {
var bogus = new mozRTCIceCandidate(
var bogus = new RTCIceCandidate(
{candidate:"Pony Lords, jump!",
sdpMLineIndex: 0});
return test.pcRemote._pc.addIceCandidate(bogus)
@ -57,7 +57,7 @@
function PC_REMOTE_ADD_CANDIDATE_MISSING_INDEX(test) {
// Note: it is probably not a good idea to automatically fill a missing
// MLineIndex with a default value of zero, see bug 1157034
var broken = new mozRTCIceCandidate(
var broken = new RTCIceCandidate(
{candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host"});
return test.pcRemote._pc.addIceCandidate(broken)
.then(
@ -66,7 +66,7 @@
);
},
function PC_REMOTE_ADD_VALID_CANDIDATE(test) {
var candidate = new mozRTCIceCandidate(
var candidate = new RTCIceCandidate(
{candidate:"candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host",
sdpMLineIndex: 0});
return test.pcRemote._pc.addIceCandidate(candidate)

View File

@ -8,11 +8,11 @@
<script type="application/javascript">
createHTML({
bug: "822674",
title: "mozRTCPeerConnection isn't a true javascript object as it should be"
title: "RTCPeerConnection isn't a true javascript object as it should be"
});
runNetworkTest(function () {
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
pc.thereIsNeverGoingToBeAPropertyWithThisNameOnThisInterface = 1;
is(pc.thereIsNeverGoingToBeAPropertyWithThisNameOnThisInterface, 1,

View File

@ -14,12 +14,12 @@
var makePC = (config, expected_error) => {
var exception;
try {
new mozRTCPeerConnection(config).close();
new RTCPeerConnection(config).close();
} catch (e) {
exception = e;
}
is((exception? exception.name : "success"), expected_error || "success",
"mozRTCPeerConnection(" + JSON.stringify(config) + ")");
"RTCPeerConnection(" + JSON.stringify(config) + ")");
};
// This is a test of the iceServers parsing code + readable errors
@ -27,11 +27,11 @@ runNetworkTest(() => {
var exception = null;
try {
new mozRTCPeerConnection().close();
new RTCPeerConnection().close();
} catch (e) {
exception = e;
}
ok(!exception, "mozRTCPeerConnection() succeeds");
ok(!exception, "RTCPeerConnection() succeeds");
exception = null;
makePC();
@ -66,14 +66,14 @@ runNetworkTest(() => {
makePC({ iceServers: [{ urls:"http:0.0.0.0" }] }, "SyntaxError");
try {
new mozRTCPeerConnection({ iceServers: [{ url:"http:0.0.0.0" }] }).close();
new RTCPeerConnection({ iceServers: [{ url:"http:0.0.0.0" }] }).close();
} catch (e) {
ok(e.message.indexOf("http") > 0,
"mozRTCPeerConnection() constructor has readable exceptions");
"RTCPeerConnection() constructor has readable exceptions");
}
// Below tests are setting the about:config User preferences for default
// ice servers and checking the outputs when mozRTCPeerConnection() is
// ice servers and checking the outputs when RTCPeerConnection() is
// invoked. See Bug 1167922 for more information.
// Note - We use promises here since the SpecialPowers API will be
// performed asynchronously.

View File

@ -12,8 +12,8 @@
});
runNetworkTest(function () {
var pc1 = new mozRTCPeerConnection();
var pc2 = new mozRTCPeerConnection();
var pc1 = new RTCPeerConnection();
var pc2 = new RTCPeerConnection();
pc1.createOffer({ offerToReceiveAudio: true }).then(offer => {
// The whole point of this test is not to wait for the

View File

@ -27,8 +27,8 @@ function pcall(o, f, beforeArg) {
});
}
var pc1 = new mozRTCPeerConnection();
var pc2 = new mozRTCPeerConnection();
var pc1 = new RTCPeerConnection();
var pc2 = new RTCPeerConnection();
var pc2_haveRemoteOffer = new Promise(resolve => {
pc2.onsignalingstatechange =

View File

@ -12,7 +12,7 @@
});
function badCertificate(config, expectedError, message) {
return mozRTCPeerConnection.generateCertificate(config)
return RTCPeerConnection.generateCertificate(config)
.then(() => ok(false, message),
e => is(e.name, expectedError, message));
}
@ -94,7 +94,7 @@
runNetworkTest(function (options) {
var expiredCert;
return Promise.resolve()
.then(() => mozRTCPeerConnection.generateCertificate({
.then(() => RTCPeerConnection.generateCertificate({
name: "ECDSA",
namedCurve: "P-256",
expires: 1 // smallest possible expiration window
@ -117,7 +117,7 @@
.then(() => {
ok(expiredCert.expires <= Date.now(), 'Cert should be at or past expiration');
try {
new mozRTCPeerConnection({ certificates: [expiredCert] });
new RTCPeerConnection({ certificates: [expiredCert] });
ok(false, 'Constructing peer connection with an expired cert is not allowed');
} catch(e) {
is(e.name, 'InvalidParameterError',
@ -126,11 +126,11 @@
})
.then(() => Promise.all([
mozRTCPeerConnection.generateCertificate({
RTCPeerConnection.generateCertificate({
name: "ECDSA",
namedCurve: "P-256"
}),
mozRTCPeerConnection.generateCertificate({
RTCPeerConnection.generateCertificate({
name: "RSASSA-PKCS1-v1_5",
hash: "SHA-256",
modulusLength: 2048,
@ -142,7 +142,7 @@
.then(storeAndRetrieve)
.then(certs => {
try {
new mozRTCPeerConnection({ certificates: certs });
new RTCPeerConnection({ certificates: certs });
ok(false, 'Constructing peer connection with multiple certs is not allowed');
} catch(e) {
is(e.name, 'NotSupportedError',

View File

@ -12,7 +12,7 @@
});
runNetworkTest(function () {
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
var exception = null;
var eTimeout = null;
@ -57,9 +57,9 @@
// These legacy methods fire the error callback instead. This is not
// entirely to spec but is better than ignoring programming errors.
var offer = new mozRTCSessionDescription({ sdp: "sdp", type: "offer" });
var answer = new mozRTCSessionDescription({ sdp: "sdp", type: "answer" });
var candidate = new mozRTCIceCandidate({ candidate: "dummy",
var offer = new RTCSessionDescription({ sdp: "sdp", type: "offer" });
var answer = new RTCSessionDescription({ sdp: "sdp", type: "answer" });
var candidate = new RTCIceCandidate({ candidate: "dummy",
sdpMid: "test",
sdpMLineIndex: 3 });

View File

@ -21,12 +21,12 @@ function PC_REMOTE_SETUP_NULL_ICE_HANDLER(test) {
test.pcRemote.setupIceCandidateHandler(test, function() {}, function () {});
}
function PC_REMOTE_ADD_FAKE_ICE_CANDIDATE(test) {
var cand = new mozRTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.1 12345 typ host","sdpMid":"","sdpMLineIndex":0});
var cand = new RTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.1 12345 typ host","sdpMid":"","sdpMLineIndex":0});
test.pcRemote.storeOrAddIceCandidate(cand);
info(test.pcRemote + " Stored fake candidate: " + JSON.stringify(cand));
}
function PC_LOCAL_ADD_FAKE_ICE_CANDIDATE(test) {
var cand = new mozRTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.2 56789 typ host","sdpMid":"","sdpMLineIndex":0});
var cand = new RTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.2 56789 typ host","sdpMid":"","sdpMLineIndex":0});
test.pcLocal.storeOrAddIceCandidate(cand);
info(test.pcLocal + " Stored fake candidate: " + JSON.stringify(cand));
}

View File

@ -17,7 +17,7 @@
};
function testCreateAnswerError() {
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
info ("Testing createAnswer error");
return pc.createAnswer()
.then(generateErrorCallback("createAnswer before offer should fail"),
@ -25,18 +25,18 @@
};
function testSetLocalDescriptionError() {
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
info ("Testing setLocalDescription error");
return pc.setLocalDescription(new mozRTCSessionDescription({ sdp: "Picklechips!",
return pc.setLocalDescription(new RTCSessionDescription({ sdp: "Picklechips!",
type: "offer" }))
.then(generateErrorCallback("setLocalDescription with nonsense SDP should fail"),
validateReason);
};
function testSetRemoteDescriptionError() {
var pc = new mozRTCPeerConnection();
var pc = new RTCPeerConnection();
info ("Testing setRemoteDescription error");
return pc.setRemoteDescription(new mozRTCSessionDescription({ sdp: "Who?",
return pc.setRemoteDescription(new RTCSessionDescription({ sdp: "Who?",
type: "offer" }))
.then(generateErrorCallback("setRemoteDescription with nonsense SDP should fail"),
validateReason);

View File

@ -20,12 +20,12 @@ function PC_REMOTE_SETUP_NULL_ICE_HANDLER(test) {
test.pcRemote.setupIceCandidateHandler(test, function() {}, function () {});
}
function PC_REMOTE_ADD_FAKE_ICE_CANDIDATE(test) {
var cand = new mozRTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.1 12345 typ host","sdpMid":"","sdpMLineIndex":0});
var cand = new RTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.1 12345 typ host","sdpMid":"","sdpMLineIndex":0});
test.pcRemote.storeOrAddIceCandidate(cand);
info(test.pcRemote + " Stored fake candidate: " + JSON.stringify(cand));
}
function PC_LOCAL_ADD_FAKE_ICE_CANDIDATE(test) {
var cand = new mozRTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.2 56789 typ host","sdpMid":"","sdpMLineIndex":0});
var cand = new RTCIceCandidate({"candidate":"candidate:0 1 UDP 2130379007 192.0.2.2 56789 typ host","sdpMid":"","sdpMLineIndex":0});
test.pcLocal.storeOrAddIceCandidate(cand);
info(test.pcLocal + " Stored fake candidate: " + JSON.stringify(cand));
}

View File

@ -39,7 +39,7 @@
function PC_REMOTE_ROLLBACK(test) {
return test.setLocalDescription(
test.pcRemote,
new mozRTCSessionDescription({ type: "rollback", sdp: ""}),
new RTCSessionDescription({ type: "rollback", sdp: ""}),
STABLE);
},

View File

@ -25,7 +25,7 @@
function PC_REMOTE_ROLLBACK(test) {
return test.setLocalDescription(
test.pcRemote,
new mozRTCSessionDescription({ type: "rollback", sdp: ""}),
new RTCSessionDescription({ type: "rollback", sdp: ""}),
STABLE);
},

View File

@ -12,8 +12,8 @@
visible: true
});
var pc1 = new mozRTCPeerConnection();
var pc2 = new mozRTCPeerConnection();
var pc1 = new RTCPeerConnection();
var pc2 = new RTCPeerConnection();
var pc2_haveRemoteOffer = new Promise(resolve => pc2.onsignalingstatechange =
e => (e.target.signalingState == "have-remote-offer") && resolve());

View File

@ -37,14 +37,14 @@
function PC_REMOTE_ROLLBACK(test) {
return test.setRemoteDescription(
test.pcRemote,
new mozRTCSessionDescription({ type: "rollback" }),
new RTCSessionDescription({ type: "rollback" }),
STABLE);
},
function PC_LOCAL_ROLLBACK(test) {
return test.setLocalDescription(
test.pcLocal,
new mozRTCSessionDescription({ type: "rollback", sdp: ""}),
new RTCSessionDescription({ type: "rollback", sdp: ""}),
STABLE);
},

View File

@ -20,14 +20,14 @@
function PC_REMOTE_ROLLBACK(test) {
return test.setRemoteDescription(
test.pcRemote,
new mozRTCSessionDescription({ type: "rollback" }),
new RTCSessionDescription({ type: "rollback" }),
STABLE);
},
function PC_LOCAL_ROLLBACK(test) {
return test.setLocalDescription(
test.pcLocal,
new mozRTCSessionDescription({ type: "rollback", sdp: ""}),
new RTCSessionDescription({ type: "rollback", sdp: ""}),
STABLE);
},

View File

@ -42,10 +42,10 @@ runNetworkTest(function () {
let pc0, pc1, pc2;
// Test failure callbacks (limited to 1 for now)
pc0 = new mozRTCPeerConnection();
pc0 = new RTCPeerConnection();
pc0.createOffer(getFail(), function(err) {
pc1 = new mozRTCPeerConnection();
pc2 = new mozRTCPeerConnection();
pc1 = new RTCPeerConnection();
pc2 = new RTCPeerConnection();
// Test success callbacks (happy path)
navigator.mozGetUserMedia({video:true, fake: true}, function(video1) {

View File

@ -8,13 +8,13 @@
<script type="application/javascript">
createHTML({
bug: "928304",
title: "test toJSON() on mozRTCSessionDescription and mozRTCIceCandidate"
title: "test toJSON() on RTCSessionDescription and RTCIceCandidate"
});
runNetworkTest(function () {
/** Test for Bug 872377 **/
var rtcSession = new mozRTCSessionDescription({ sdp: "Picklechips!",
var rtcSession = new RTCSessionDescription({ sdp: "Picklechips!",
type: "offer" });
var jsonCopy = JSON.parse(JSON.stringify(rtcSession));
for (key in rtcSession) {
@ -24,7 +24,7 @@
/** Test for Bug 928304 **/
var rtcIceCandidate = new mozRTCIceCandidate({ candidate: "dummy",
var rtcIceCandidate = new RTCIceCandidate({ candidate: "dummy",
sdpMid: "test",
sdpMLineIndex: 3 });
jsonCopy = JSON.parse(JSON.stringify(rtcIceCandidate));

View File

@ -117,9 +117,6 @@ var ecmaGlobals =
var legacyMozPrefixedInterfaces =
[
"mozContact",
"mozRTCIceCandidate",
"mozRTCPeerConnection",
"mozRTCSessionDescription",
];
// IMPORTANT: Do not change the list above without review from a DOM peer,
// except to remove items from it!
@ -812,12 +809,6 @@ var interfaceNamesInGlobalScope =
{name: "MozOtaStatusEvent", b2g: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
"MozPowerManager",
// IMPORTANT: Do not change this list without review from a DOM peer!
"mozRTCIceCandidate",
// IMPORTANT: Do not change this list without review from a DOM peer!
"mozRTCPeerConnection",
// IMPORTANT: Do not change this list without review from a DOM peer!
"mozRTCSessionDescription",
// IMPORTANT: Do not change this list without review from a DOM peer!
"MozSettingsEvent",
// IMPORTANT: Do not change this list without review from a DOM peer!
@ -974,12 +965,18 @@ var interfaceNamesInGlobalScope =
"RTCCertificate",
// IMPORTANT: Do not change this list without review from a DOM peer!
"RTCDataChannelEvent",
// IMPORTANT: Do not change this list without review from a DOM peer!
"RTCIceCandidate",
// IMPORTANT: Do not change this list without review from a DOM peer!
"RTCPeerConnection",
// IMPORTANT: Do not change this list without review from a DOM peer!
"RTCPeerConnectionIceEvent",
// IMPORTANT: Do not change this list without review from a DOM peer!
"RTCRtpReceiver",
// IMPORTANT: Do not change this list without review from a DOM peer!
"RTCRtpSender",
// IMPORTANT: Do not change this list without review from a DOM peer!
"RTCSessionDescription",
// IMPORTANT: Do not change this list without review from a DOM peer!
"RTCStatsReport",
// IMPORTANT: Do not change this list without review from a DOM peer!

View File

@ -389,7 +389,8 @@ partial interface Navigator {
readonly attribute MediaDevices mediaDevices;
// Deprecated. Use mediaDevices.getUserMedia instead.
[Throws, Func="Navigator::HasUserMediaSupport", UnsafeInPrerendering]
[Deprecated="NavigatorGetUserMedia", Throws,
Func="Navigator::HasUserMediaSupport", UnsafeInPrerendering]
void mozGetUserMedia(MediaStreamConstraints constraints,
NavigatorUserMediaSuccessCallback successCallback,
NavigatorUserMediaErrorCallback errorCallback);

View File

@ -5,7 +5,7 @@
*
* PeerConnection.js' interface to the C++ PeerConnectionImpl.
*
* Do not confuse with mozRTCPeerConnection. This interface is purely for
* Do not confuse with RTCPeerConnection. This interface is purely for
* communication between the PeerConnection JS DOM binding and the C++
* implementation in SIPCC.
*

View File

@ -8,7 +8,7 @@ interface nsISupports;
[ChromeOnly,
JSImplementation="@mozilla.org/dom/peerconnectionobserver;1",
Constructor (mozRTCPeerConnection domPC)]
Constructor (RTCPeerConnection domPC)]
interface PeerConnectionObserver
{
/* JSEP callbacks */

View File

@ -16,7 +16,7 @@ dictionary RTCIceCandidateInit {
[Pref="media.peerconnection.enabled",
JSImplementation="@mozilla.org/dom/rtcicecandidate;1",
Constructor(optional RTCIceCandidateInit candidateInitDict)]
interface mozRTCIceCandidate {
interface RTCIceCandidate {
attribute DOMString? candidate;
attribute DOMString? sdpMid;
attribute unsigned short? sdpMLineIndex;

View File

@ -7,7 +7,7 @@
* http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCPeerConnection
*/
callback RTCSessionDescriptionCallback = void (mozRTCSessionDescription sdp);
callback RTCSessionDescriptionCallback = void (RTCSessionDescription sdp);
callback RTCPeerConnectionErrorCallback = void (DOMError error);
callback VoidFunction = void ();
callback RTCStatsCallback = void (RTCStatsReport report);
@ -62,6 +62,9 @@ dictionary RTCAnswerOptions : RTCOfferAnswerOptions {
dictionary RTCOfferOptions : RTCOfferAnswerOptions {
long offerToReceiveVideo;
long offerToReceiveAudio;
// boolean iceRestart = false; // Not implemented (Bug 906986)
// Mozilla proprietary options (at risk: Bug 1196974)
boolean mozDontOfferDataChannel;
boolean mozBundleOnly;
@ -83,8 +86,7 @@ interface RTCDataChannel;
JSImplementation="@mozilla.org/dom/peerconnection;1",
Constructor (optional RTCConfiguration configuration,
optional object? constraints)]
// moz-prefixed until sufficiently standardized.
interface mozRTCPeerConnection : EventTarget {
interface RTCPeerConnection : EventTarget {
[Throws, StaticClassOverride="mozilla::dom::RTCCertificate"]
static Promise<RTCCertificate> generateCertificate (AlgorithmIdentifier keygenAlgorithm);
@ -94,15 +96,15 @@ interface mozRTCPeerConnection : EventTarget {
optional DOMString username);
[Pref="media.peerconnection.identity.enabled"]
Promise<DOMString> getIdentityAssertion();
Promise<mozRTCSessionDescription> createOffer (optional RTCOfferOptions options);
Promise<mozRTCSessionDescription> createAnswer (optional RTCAnswerOptions options);
Promise<void> setLocalDescription (mozRTCSessionDescription description);
Promise<void> setRemoteDescription (mozRTCSessionDescription description);
readonly attribute mozRTCSessionDescription? localDescription;
readonly attribute mozRTCSessionDescription? remoteDescription;
Promise<RTCSessionDescription> createOffer (optional RTCOfferOptions options);
Promise<RTCSessionDescription> createAnswer (optional RTCAnswerOptions options);
Promise<void> setLocalDescription (RTCSessionDescription description);
Promise<void> setRemoteDescription (RTCSessionDescription description);
readonly attribute RTCSessionDescription? localDescription;
readonly attribute RTCSessionDescription? remoteDescription;
readonly attribute RTCSignalingState signalingState;
void updateIce (optional RTCConfiguration configuration);
Promise<void> addIceCandidate (mozRTCIceCandidate candidate);
Promise<void> addIceCandidate (RTCIceCandidate candidate);
readonly attribute RTCIceGatheringState iceGatheringState;
readonly attribute RTCIceConnectionState iceConnectionState;
[Pref="media.peerconnection.identity.enabled"]
@ -154,7 +156,7 @@ interface mozRTCPeerConnection : EventTarget {
// Legacy callback API
partial interface mozRTCPeerConnection {
partial interface RTCPeerConnection {
// Dummy Promise<void> return values avoid "WebIDL.WebIDLError: error:
// We have overloads with both Promise and non-Promise return types"
@ -164,13 +166,13 @@ partial interface mozRTCPeerConnection {
optional RTCOfferOptions options);
Promise<void> createAnswer (RTCSessionDescriptionCallback successCallback,
RTCPeerConnectionErrorCallback failureCallback);
Promise<void> setLocalDescription (mozRTCSessionDescription description,
Promise<void> setLocalDescription (RTCSessionDescription description,
VoidFunction successCallback,
RTCPeerConnectionErrorCallback failureCallback);
Promise<void> setRemoteDescription (mozRTCSessionDescription description,
Promise<void> setRemoteDescription (RTCSessionDescription description,
VoidFunction successCallback,
RTCPeerConnectionErrorCallback failureCallback);
Promise<void> addIceCandidate (mozRTCIceCandidate candidate,
Promise<void> addIceCandidate (RTCIceCandidate candidate,
VoidFunction successCallback,
RTCPeerConnectionErrorCallback failureCallback);
Promise<void> getStats (MediaStreamTrack? selector,

View File

@ -8,12 +8,12 @@
*/
dictionary RTCPeerConnectionIceEventInit : EventInit {
mozRTCIceCandidate? candidate = null;
RTCIceCandidate? candidate = null;
};
[Pref="media.peerconnection.enabled",
Constructor(DOMString type,
optional RTCPeerConnectionIceEventInit eventInitDict)]
interface RTCPeerConnectionIceEvent : Event {
readonly attribute mozRTCIceCandidate? candidate;
readonly attribute RTCIceCandidate? candidate;
};

View File

@ -8,7 +8,7 @@
Right now, it is not possible to add static functions to a JS implemented
interface (see bug 863952), so we need to create a simple interface with a
trivial constructor and no data to hold these functions that really ought to
be static in mozRTCPeerConnection.
be static in RTCPeerConnection.
TODO(bcampen@mozilla.com) Merge this code into RTCPeerConnection once this
limitation is gone. (Bug 1017082)
*/
@ -19,7 +19,7 @@ enum RTCLifecycleEvent {
"iceconnectionstatechange"
};
callback PeerConnectionLifecycleCallback = void (mozRTCPeerConnection pc,
callback PeerConnectionLifecycleCallback = void (RTCPeerConnection pc,
unsigned long long windowId,
RTCLifecycleEvent eventType);
@ -27,7 +27,7 @@ callback PeerConnectionLifecycleCallback = void (mozRTCPeerConnection pc,
Pref="media.peerconnection.enabled",
JSImplementation="@mozilla.org/dom/peerconnectionstatic;1",
Constructor()]
interface mozRTCPeerConnectionStatic {
interface RTCPeerConnectionStatic {
/* One slot per window (the window in which the register call is made),
automatically unregistered when window goes away.

View File

@ -22,7 +22,7 @@ dictionary RTCSessionDescriptionInit {
[Pref="media.peerconnection.enabled",
JSImplementation="@mozilla.org/dom/rtcsessiondescription;1",
Constructor(optional RTCSessionDescriptionInit descriptionInitDict)]
interface mozRTCSessionDescription {
interface RTCSessionDescription {
attribute RTCSdpType? type;
attribute DOMString? sdp;

View File

@ -0,0 +1,21 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file includes all the deprecated mozRTC prefixed interfaces.
*
* The declaration of each should match the declaration of the real, unprefixed
* interface.
*/
[NoInterfaceObject]
interface WebrtcDeprecated
{
[Deprecated="WebrtcDeprecatedPrefix", Pref="media.peerconnection.enabled"]
readonly attribute object mozRTCIceCandidate;
[Deprecated="WebrtcDeprecatedPrefix", Pref="media.peerconnection.enabled"]
readonly attribute object mozRTCPeerConnection;
[Deprecated="WebrtcDeprecatedPrefix", Pref="media.peerconnection.enabled"]
readonly attribute object mozRTCSessionDescription;
};

View File

@ -31,7 +31,7 @@ typedef any Transferable;
[Replaceable, Constant, StoreInSlot,
CrossOriginReadable] readonly attribute Window self;
[Unforgeable, StoreInSlot, Pure] readonly attribute Document? document;
[Throws] attribute DOMString name;
[Throws] attribute DOMString name;
[PutForwards=href, Unforgeable, Throws,
CrossOriginReadable, CrossOriginWritable] readonly attribute Location? location;
[Throws] readonly attribute History history;
@ -65,7 +65,7 @@ typedef any Transferable;
getter object (DOMString name);
// the user agent
[Throws] readonly attribute Navigator navigator;
[Throws] readonly attribute Navigator navigator;
#ifdef HAVE_SIDEBAR
[Replaceable, Throws] readonly attribute External external;
#endif
@ -343,7 +343,7 @@ partial interface Window {
* This property exists because static attributes don't yet work for
* JS-implemented WebIDL (see bugs 1058606 and 863952). With this hack, we
* can use `MozSelfSupport.something(...)`, which will continue to work
* after we ditch this property and switch to static attributes. See
* after we ditch this property and switch to static attributes. See
*/
[ChromeOnly, Throws] readonly attribute MozSelfSupport MozSelfSupport;
@ -484,3 +484,4 @@ interface ChromeWindow {
Window implements ChromeWindow;
Window implements GlobalFetch;
Window implements ImageBitmapFactories;
Window implements WebrtcDeprecated;

View File

@ -628,6 +628,7 @@ if CONFIG['MOZ_WEBRTC']:
'RTCRtpReceiver.webidl',
'RTCRtpSender.webidl',
'RTCSessionDescription.webidl',
'WebrtcDeprecated.webidl',
'WebrtcGlobalInformation.webidl',
]

View File

@ -6,7 +6,7 @@ if (navigator.mozGetUserMedia) {
console.log("This appears to be Firefox");
// The RTCPeerConnection object.
RTCPeerConnection = mozRTCPeerConnection;
RTCPeerConnection = RTCPeerConnection || mozRTCPeerConnection;
// Get UserMedia (only difference is the prefix).
// Code from Adam Barth.

View File

@ -49,14 +49,14 @@ if (navigator.mozGetUserMedia) {
var RTCPeerConnection = function(pcConfig, pcConstraints) {
// .urls is not supported in FF yet.
maybeFixConfiguration(pcConfig);
return new mozRTCPeerConnection(pcConfig, pcConstraints);
return new (RTCPeerConnectioni || mozRTCPeerConnection)(pcConfig, pcConstraints);
}
// The RTCSessionDescription object.
RTCSessionDescription = mozRTCSessionDescription;
RTCSessionDescription = RTCSessionDescription || mozRTCSessionDescription;
// The RTCIceCandidate object.
RTCIceCandidate = mozRTCIceCandidate;
RTCIceCandidate = RTCIceCandidate || mozRTCIceCandidate;
// Get UserMedia (only difference is the prefix).
// Code from Adam Barth.

View File

@ -19,14 +19,14 @@ var failure = function(x) {
var TabMirror = function(deviceId, window) {
this.deviceId = deviceId;
// Save mozRTCSessionDescription and mozRTCIceCandidate for later when the window object is not available.
this.RTCSessionDescription = window.mozRTCSessionDescription;
this.RTCIceCandidate = window.mozRTCIceCandidate;
// Save RTCSessionDescription and RTCIceCandidate for later when the window object is not available.
this.RTCSessionDescription = window.RTCSessionDescription;
this.RTCIceCandidate = window.RTCIceCandidate;
Services.obs.addObserver((aSubject, aTopic, aData) => this._processMessage(aData), "MediaPlayer:Response", false);
this._sendMessage({ start: true });
this._window = window;
this._pc = new window.mozRTCPeerConnection(CONFIG, {});
this._pc = new window.RTCPeerConnection(CONFIG, {});
if (!this._pc) {
throw "Failure creating Webrtc object";
}