Files
tubestation/testing/web-platform/tests/webrtc/RTCRtpParameters-headerExtensions.html
Florent Castelli 83cc9f9b9d Bug 1626243 [wpt PR 22561] - Implement and ship RTCRtpSendParameters.degradationPreference, a=testonly
Automatic update from web-platform-tests
Implement and ship RTCRtpSendParameters.degradationPreference

Intent: https://groups.google.com/a/chromium.org/g/blink-dev/c/WPvxi5nUK2E/m/Xd0ZzPwxAwAJ

Bug: 857041
Change-Id: I3f11c310624d5c2153eefbf9c1e08383d9aad4f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2074777
Commit-Queue: Florent Castelli <orphis@chromium.org>
Reviewed-by: Henrik Boström <hbos@chromium.org>
Auto-Submit: Florent Castelli <orphis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755512}

--

wpt-commits: 4f34fd4cdd7713a5300f8eb3fb090c83e3c070e6
wpt-pr: 22561
2020-04-09 10:35:48 +00:00

75 lines
2.5 KiB
HTML

<!doctype html>
<meta charset=utf-8>
<title>RTCRtpParameters headerExtensions</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="dictionary-helper.js"></script>
<script src="RTCRtpParameters-helper.js"></script>
<script>
'use strict';
// Test is based on the following editor draft:
// https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html
// The following helper functions are called from RTCRtpParameters-helper.js:
// validateSenderRtpParameters
/*
5.2. RTCRtpSender Interface
interface RTCRtpSender {
Promise<void> setParameters(optional RTCRtpParameters parameters);
RTCRtpParameters getParameters();
};
dictionary RTCRtpParameters {
DOMString transactionId;
sequence<RTCRtpEncodingParameters> encodings;
sequence<RTCRtpHeaderExtensionParameters> headerExtensions;
RTCRtcpParameters rtcp;
sequence<RTCRtpCodecParameters> codecs;
};
dictionary RTCRtpHeaderExtensionParameters {
[readonly]
DOMString uri;
[readonly]
unsigned short id;
[readonly]
boolean encrypted;
};
getParameters
- The headerExtensions sequence is populated based on the header extensions
that have been negotiated for sending.
*/
/*
5.2. setParameters
7. If parameters.encodings.length is different from N, or if any parameter
in the parameters argument, marked as a Read-only parameter, has a value
that is different from the corresponding parameter value returned from
sender.getParameters(), abort these steps and return a promise rejected
with a newly created InvalidModificationError. Note that this also applies
to transactionId.
*/
promise_test(t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const { sender } = pc.addTransceiver('audio');
const param = sender.getParameters();
validateSenderRtpParameters(param);
param.headerExtensions = [{
uri: 'non-existent.example.org',
id: 404,
encrypted: false
}];
return promise_rejects_dom(t, 'InvalidModificationError',
sender.setParameters(param));
}, `setParameters() with modified headerExtensions should reject with InvalidModificationError`);
</script>