diff options
author | Basilisk-Dev <basiliskdev@protonmail.com> | 2023-10-09 17:09:04 -0400 |
---|---|---|
committer | Basilisk-Dev <basiliskdev@protonmail.com> | 2023-10-09 17:09:04 -0400 |
commit | 95a8edc5fc34800f4823a216fad64de5b966d0a0 (patch) | |
tree | 170ccc34555650038f841c6f26e5d6e9ad521a5e | |
parent | 38dfadad45fe43d08de05706dc3332f41e94aee5 (diff) | |
download | uxp-95a8edc5fc34800f4823a216fad64de5b966d0a0.tar.gz |
Issue #2332 - Update most tests to skip RTCSessionDescription construction
Backport of https://bugzilla.mozilla.org/show_bug.cgi?id=1263312 part 6
9 files changed, 24 insertions, 37 deletions
diff --git a/dom/media/tests/mochitest/identity/test_fingerprints.html b/dom/media/tests/mochitest/identity/test_fingerprints.html index 0fd065af26..bf26c2fdd5 100644 --- a/dom/media/tests/mochitest/identity/test_fingerprints.html +++ b/dom/media/tests/mochitest/identity/test_fingerprints.html @@ -86,8 +86,7 @@ function testMultipleFingerprints() { fingerprintSdp(fingerprints.slice(1)) + offer.sdp.slice(match.index); - var desc = new RTCSessionDescription({ type: 'offer', sdp: sdp }); - return pcStrict.setRemoteDescription(desc); + return pcStrict.setRemoteDescription({ type: 'offer', sdp }); }) .then(() => { ok(true, 'Modified fingerprints were accepted'); diff --git a/dom/media/tests/mochitest/pc.js b/dom/media/tests/mochitest/pc.js index 2e9c7c63f1..4363841da7 100644 --- a/dom/media/tests/mochitest/pc.js +++ b/dom/media/tests/mochitest/pc.js @@ -334,7 +334,7 @@ PeerConnectionTest.prototype.createOffer = function(peer) { * * @param {PeerConnectionWrapper} peer The peer connection wrapper to run the command on - * @param {RTCSessionDescription} desc + * @param {RTCSessionDescriptionInit} desc * Session description for the local description request */ PeerConnectionTest.prototype.setLocalDescription = @@ -403,7 +403,7 @@ PeerConnectionTest.prototype.setOfferOptions = function(options) { * * @param {PeerConnectionWrapper} peer The peer connection wrapper to run the command on - * @param {RTCSessionDescription} desc + * @param {RTCSessionDescriptionInit} desc * Session description for the remote description request */ PeerConnectionTest.prototype.setRemoteDescription = @@ -1064,7 +1064,7 @@ PeerConnectionWrapper.prototype = { * Sets the local description and automatically handles the failure case. * * @param {object} desc - * RTCSessionDescription for the local description request + * RTCSessionDescriptionInit for the local description request */ setLocalDescription : function(desc) { this.observedNegotiationNeeded = undefined; @@ -1078,7 +1078,7 @@ PeerConnectionWrapper.prototype = { * causes the test case to fail if the call succeeds. * * @param {object} desc - * RTCSessionDescription for the local description request + * RTCSessionDescriptionInit for the local description request * @returns {Promise} * A promise that resolves to the expected error */ @@ -1095,7 +1095,7 @@ PeerConnectionWrapper.prototype = { * Sets the remote description and automatically handles the failure case. * * @param {object} desc - * RTCSessionDescription for the remote description request + * RTCSessionDescriptionInit for the remote description request */ setRemoteDescription : function(desc) { this.observedNegotiationNeeded = undefined; @@ -1115,7 +1115,7 @@ PeerConnectionWrapper.prototype = { * causes the test case to fail if the call succeeds. * * @param {object} desc - * RTCSessionDescription for the remote description request + * RTCSessionDescriptionInit for the remote description request * @returns {Promise} * a promise that resolve to the returned error */ diff --git a/dom/media/tests/mochitest/test_peerConnection_errorCallbacks.html b/dom/media/tests/mochitest/test_peerConnection_errorCallbacks.html index 6d152a4fa6..9ae3b8d50f 100644 --- a/dom/media/tests/mochitest/test_peerConnection_errorCallbacks.html +++ b/dom/media/tests/mochitest/test_peerConnection_errorCallbacks.html @@ -27,8 +27,7 @@ function testSetLocalDescriptionError() { var pc = new RTCPeerConnection(); info ("Testing setLocalDescription error"); - return pc.setLocalDescription(new RTCSessionDescription({ sdp: "Picklechips!", - type: "offer" })) + return pc.setLocalDescription({ sdp: "Picklechips!", type: "offer" }) .then(generateErrorCallback("setLocalDescription with nonsense SDP should fail"), validateReason); }; @@ -36,8 +35,7 @@ function testSetRemoteDescriptionError() { var pc = new RTCPeerConnection(); info ("Testing setRemoteDescription error"); - return pc.setRemoteDescription(new RTCSessionDescription({ sdp: "Who?", - type: "offer" })) + return pc.setRemoteDescription({ sdp: "Who?", type: "offer" }) .then(generateErrorCallback("setRemoteDescription with nonsense SDP should fail"), validateReason); }; diff --git a/dom/media/tests/mochitest/test_peerConnection_localReofferRollback.html b/dom/media/tests/mochitest/test_peerConnection_localReofferRollback.html index 0b0b35fe80..ed149747ca 100644 --- a/dom/media/tests/mochitest/test_peerConnection_localReofferRollback.html +++ b/dom/media/tests/mochitest/test_peerConnection_localReofferRollback.html @@ -37,10 +37,9 @@ }, function PC_REMOTE_ROLLBACK(test) { - return test.setLocalDescription( - test.pcRemote, - new RTCSessionDescription({ type: "rollback", sdp: ""}), - STABLE); + return test.setLocalDescription(test.pcRemote, + { type: "rollback", sdp: "" }, + STABLE); }, // Rolling back should shut down gathering diff --git a/dom/media/tests/mochitest/test_peerConnection_localRollback.html b/dom/media/tests/mochitest/test_peerConnection_localRollback.html index 2a35920baa..45ceba844e 100644 --- a/dom/media/tests/mochitest/test_peerConnection_localRollback.html +++ b/dom/media/tests/mochitest/test_peerConnection_localRollback.html @@ -23,10 +23,9 @@ }, function PC_REMOTE_ROLLBACK(test) { - return test.setLocalDescription( - test.pcRemote, - new RTCSessionDescription({ type: "rollback", sdp: ""}), - STABLE); + return test.setLocalDescription(test.pcRemote, + { type: "rollback", sdp: "" }, + STABLE); }, // Rolling back should shut down gathering diff --git a/dom/media/tests/mochitest/test_peerConnection_remoteReofferRollback.html b/dom/media/tests/mochitest/test_peerConnection_remoteReofferRollback.html index 6b518e1d29..7580358b86 100644 --- a/dom/media/tests/mochitest/test_peerConnection_remoteReofferRollback.html +++ b/dom/media/tests/mochitest/test_peerConnection_remoteReofferRollback.html @@ -35,10 +35,8 @@ }, function PC_REMOTE_ROLLBACK(test) { - return test.setRemoteDescription( - test.pcRemote, - new RTCSessionDescription({ type: "rollback" }), - STABLE) + return test.setRemoteDescription(test.pcRemote, { type: "rollback" }, + STABLE) .then(() => test.pcRemote.rollbackRemoteTracksIfNotNegotiated()); }, diff --git a/dom/media/tests/mochitest/test_peerConnection_remoteRollback.html b/dom/media/tests/mochitest/test_peerConnection_remoteRollback.html index 099628ab88..35a51d03c0 100644 --- a/dom/media/tests/mochitest/test_peerConnection_remoteRollback.html +++ b/dom/media/tests/mochitest/test_peerConnection_remoteRollback.html @@ -20,10 +20,8 @@ function PC_REMOTE_ROLLBACK(test) { // We still haven't negotiated the tracks test.pcRemote.expectNegotiationNeeded(); - return test.setRemoteDescription( - test.pcRemote, - new RTCSessionDescription({ type: "rollback" }), - STABLE) + return test.setRemoteDescription(test.pcRemote, { type: "rollback" }, + STABLE) .then(() => test.pcRemote.rollbackRemoteTracksIfNotNegotiated()); }, diff --git a/dom/media/tests/mochitest/test_peerConnection_restartIceLocalAndRemoteRollback.html b/dom/media/tests/mochitest/test_peerConnection_restartIceLocalAndRemoteRollback.html index e926171644..d2280cee87 100644 --- a/dom/media/tests/mochitest/test_peerConnection_restartIceLocalAndRemoteRollback.html +++ b/dom/media/tests/mochitest/test_peerConnection_restartIceLocalAndRemoteRollback.html @@ -51,10 +51,8 @@ }, function PC_REMOTE_ROLLBACK(test) { - return test.setRemoteDescription( - test.pcRemote, - new RTCSessionDescription({ type: "rollback" }), - STABLE); + return test.setRemoteDescription(test.pcRemote, { type: "rollback" }, + STABLE); }, function PC_LOCAL_ROLLBACK(test) { diff --git a/dom/media/tests/mochitest/test_peerConnection_restartIceLocalRollback.html b/dom/media/tests/mochitest/test_peerConnection_restartIceLocalRollback.html index c1ac186de1..fd9fee9c0c 100644 --- a/dom/media/tests/mochitest/test_peerConnection_restartIceLocalRollback.html +++ b/dom/media/tests/mochitest/test_peerConnection_restartIceLocalRollback.html @@ -42,11 +42,9 @@ test.pcLocal.iceCheckingIceRollbackExpected = true; }, function PC_LOCAL_ROLLBACK(test) { - return test.setLocalDescription( - test.pcLocal, - new RTCSessionDescription({ type: "rollback", - sdp: ""}), - STABLE); + return test.setLocalDescription(test.pcLocal, + { type: "rollback", sdp: ""}, + STABLE); }, // Rolling back should shut down gathering function PC_LOCAL_WAIT_FOR_END_OF_TRICKLE(test) { |