Bug 1824381 [wpt PR 39181] - WebRTC WPT: Test that the answer negotiates a subset of RTP header extensions, a=testonly

Automatic update from web-platform-tests
WebRTC WPT: Test that the answer negotiates a subset of RTP header extensions

as defined in JSEP
  https://www.rfc-editor.org/rfc/rfc8829.html#section-5.3.1:

  For each supported RTP header extension that is present in the offer,
  [add] an "a=extmap" line

BUG=None

Change-Id: Ic9e2195a8a6aa011c8938f8a5ef0d74055d36cc8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4369845
Reviewed-by: Henrik Boström <hbos@chromium.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1121783}

--

wpt-commits: 10c4049e41aec3e9945381e64aa8ab638eb00a6f
wpt-pr: 39181
This commit is contained in:
Philipp Hancke 2023-03-30 11:07:22 +00:00 коммит произвёл moz-wptsync-bot
Родитель 2d31f294f2
Коммит 80a22de8bc
1 изменённых файлов: 22 добавлений и 0 удалений

Просмотреть файл

@ -76,4 +76,26 @@ a=setup:actpass
}, testcase.description + ' header extension is supported.');
});
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
pc.addTransceiver('video');
const offer = await pc.createOffer();
const section = SDPUtils.splitSections(offer.sdp)[1];
const extensions = SDPUtils.matchPrefix(section, 'a=extmap:')
.map(line => SDPUtils.parseExtmap(line));
const extension_not_mid = extensions.find(e => e.uri !== 'urn:ietf:params:rtp-hdrext:sdes:mid');
await pc.setRemoteDescription({type :'offer', sdp: offer.sdp.replace(extension_not_mid.uri, 'bogus')});
await pc.setLocalDescription();
const answer_section = SDPUtils.splitSections(pc.localDescription.sdp)[1];
const answer_extensions = SDPUtils.matchPrefix(answer_section, 'a=extmap:')
.map(line => SDPUtils.parseExtmap(line));
assert_equals(answer_extensions.length, extensions.length - 1);
assert_false(!!extensions.find(e => e.uri === 'bogus'));
for (const answer_extension of answer_extensions) {
assert_true(!!extensions.find(e => e.uri === answer_extension.uri));
}
}, 'Negotiates the subset of supported extensions offered');
</script>