Skip to content

Commit

Permalink
Make sure we hold a reference to the pc in these tests.
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D201243

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1838413
gecko-commit: 7c4a0321d30adfc6bad65e11ceecb1d8fd96b1d3
gecko-reviewers: pehrsons
  • Loading branch information
docfaraday authored and moz-wptsync-bot committed Feb 12, 2024
1 parent 24531eb commit 36f966f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions webrtc/resources/webrtc-test-helpers.sub.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ const candidate = {
// Opens a new WebRTC connection.
async function openWebRTC(remoteContextHelper) {
await remoteContextHelper.executeScript(async (sessionDesc, candidate) => {
const testRTCPeerConnection = new RTCPeerConnection();
await testRTCPeerConnection.setRemoteDescription(sessionDesc);
await testRTCPeerConnection.addIceCandidate(candidate);
window.testRTCPeerConnection = new RTCPeerConnection();
await window.testRTCPeerConnection.setRemoteDescription(sessionDesc);
await window.testRTCPeerConnection.addIceCandidate(candidate);
}, [sessionDesc, candidate]);
}

// Opens a new WebRTC connection and then close it.
async function openThenCloseWebRTC(remoteContextHelper) {
await remoteContextHelper.executeScript(async (sessionDesc, candidate) => {
const testRTCPeerConnection = new RTCPeerConnection();
await testRTCPeerConnection.setRemoteDescription(sessionDesc);
await testRTCPeerConnection.addIceCandidate(candidate);
testRTCPeerConnection.close();
window.testRTCPeerConnection = new RTCPeerConnection();
await window.testRTCPeerConnection.setRemoteDescription(sessionDesc);
await window.testRTCPeerConnection.addIceCandidate(candidate);
window.testRTCPeerConnection.close();
}, [sessionDesc, candidate]);
}

0 comments on commit 36f966f

Please sign in to comment.