summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/tests/mochitests/test_peerConnection_sillyCodecPriorities.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/media/webrtc/tests/mochitests/test_peerConnection_sillyCodecPriorities.html
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/webrtc/tests/mochitests/test_peerConnection_sillyCodecPriorities.html')
-rw-r--r--dom/media/webrtc/tests/mochitests/test_peerConnection_sillyCodecPriorities.html12
1 files changed, 5 insertions, 7 deletions
diff --git a/dom/media/webrtc/tests/mochitests/test_peerConnection_sillyCodecPriorities.html b/dom/media/webrtc/tests/mochitests/test_peerConnection_sillyCodecPriorities.html
index c8354356b0..aa0644ebbb 100644
--- a/dom/media/webrtc/tests/mochitests/test_peerConnection_sillyCodecPriorities.html
+++ b/dom/media/webrtc/tests/mochitests/test_peerConnection_sillyCodecPriorities.html
@@ -15,12 +15,12 @@
visible: true
});
- function makeCodecTopPriority(sdp, codec) {
+ function makeCodecTopPriority({type, sdp}, codec) {
const ptToMove = sdputils.findCodecId(sdp, codec);
- return sdp.replace(
+ return {type, sdp: sdp.replace(
// m=video port type pts ptToMove more-pts?
new RegExp(`(m=video [^ ]+ [^ ]+)(.*)( ${ptToMove})( [^ ]+)?`, "g"),
- '$1$3$2$4');
+ '$1$3$2$4')};
}
function isCodecFirst(sdp, codec) {
@@ -34,8 +34,7 @@
const stream = await navigator.mediaDevices.getUserMedia({ video: true });
const sender = pc1.addTrack(stream.getTracks()[0]);
await pc1.setLocalDescription();
- let mungedOffer = pc1.localDescription;
- mungedOffer.sdp = makeCodecTopPriority(mungedOffer.sdp, codec);
+ const mungedOffer = makeCodecTopPriority(pc1.localDescription, codec);
await pc2.setRemoteDescription(mungedOffer);
await pc2.setLocalDescription();
await pc1.setRemoteDescription(pc2.localDescription);
@@ -51,8 +50,7 @@
await pc1.setLocalDescription();
await pc2.setRemoteDescription(pc1.localDescription);
await pc2.setLocalDescription();
- let mungedAnswer = pc2.localDescription;
- mungedAnswer.sdp = makeCodecTopPriority(mungedAnswer.sdp, codec);
+ const mungedAnswer = makeCodecTopPriority(pc2.localDescription, codec);
await pc1.setRemoteDescription(mungedAnswer);
is(isCodecFirst((await pc1.createOffer()).sdp, codec), !isPseudoCodec,
"Top-priority codecs should come first in reoffers, unless they are pseudo codecs (eg; ulpfec)");