mirror of
https://github.com/servo/servo.git
synced 2025-08-29 17:18:23 +01:00
Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326
This commit is contained in:
parent
462c272380
commit
1f531f66ea
5377 changed files with 174916 additions and 84369 deletions
105
tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-rtcp.html
Normal file
105
tests/wpt/web-platform-tests/webrtc/RTCRtpParameters-rtcp.html
Normal file
|
@ -0,0 +1,105 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>RTCRtpParameters rtcp</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;
|
||||
RTCDegradationPreference degradationPreference;
|
||||
};
|
||||
|
||||
dictionary RTCRtcpParameters {
|
||||
[readonly]
|
||||
DOMString cname;
|
||||
|
||||
[readonly]
|
||||
boolean reducedSize;
|
||||
};
|
||||
|
||||
getParameters
|
||||
- rtcp.cname is set to the CNAME of the associated RTCPeerConnection.
|
||||
|
||||
rtcp.reducedSize is set to true if reduced-size RTCP has been negotiated for
|
||||
sending, and false otherwise.
|
||||
*/
|
||||
|
||||
/*
|
||||
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();
|
||||
const { sender } = pc.addTransceiver('audio');
|
||||
|
||||
const param = sender.getParameters();
|
||||
validateSenderRtpParameters(param);
|
||||
|
||||
const { rtcp } = param;
|
||||
|
||||
if(rtcp === undefined) {
|
||||
param.rtcp = { cname: 'foo' };
|
||||
|
||||
} else if(rtcp.cname === undefined) {
|
||||
rtcp.cname = 'foo';
|
||||
|
||||
} else {
|
||||
rtcp.cname = `${rtcp.cname}-modified`;
|
||||
}
|
||||
|
||||
return promise_rejects(t, 'InvalidModificationError',
|
||||
sender.setParameters(param));
|
||||
|
||||
}, `setParameters() with modified rtcp.cname should reject with InvalidModificationError`);
|
||||
|
||||
promise_test(t => {
|
||||
const pc = new RTCPeerConnection();
|
||||
const { sender } = pc.addTransceiver('audio');
|
||||
|
||||
const param = sender.getParameters();
|
||||
validateSenderRtpParameters(param);
|
||||
|
||||
const { rtcp } = param;
|
||||
|
||||
if(rtcp === undefined) {
|
||||
param.rtcp = { reducedSize: true };
|
||||
|
||||
} else if(rtcp.reducedSize === undefined) {
|
||||
rtcp.reducedSize = true;
|
||||
|
||||
} else {
|
||||
rtcp.reducedSize = !rtcp.reducedSize;
|
||||
}
|
||||
|
||||
return promise_rejects(t, 'InvalidModificationError',
|
||||
sender.setParameters(param));
|
||||
|
||||
}, `setParameters() with modified rtcp.reducedSize should reject with InvalidModificationError`);
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue