blob: 8b6d648bf616c847d9d8300a09f8ab078ac026ce [file] [log] [blame]
Soares Chen172fe9d2017-07-18 09:30:181<!doctype html>
2<meta charset=utf-8>
3<title>RTCRtpReceiver.prototype.getParameters</title>
4<script src="/resources/testharness.js"></script>
5<script src="/resources/testharnessreport.js"></script>
6<script src="dictionary-helper.js"></script>
7<script src="RTCRtpParameters-helper.js"></script>
8<script>
9 'use strict';
10
11 // Test is based on the following editor draft:
12 // https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html
13
14 // The following helper functions are called from RTCRtpParameters-helper.js:
15 // validateReceiverRtpParameters
16
17 /*
18 Validates the RTCRtpParameters returned from RTCRtpReceiver.prototype.getParameters
19
20 5.3. RTCRtpReceiver Interface
21 getParameters
22 When getParameters is called, the RTCRtpParameters dictionary is constructed
23 as follows:
24
25 - encodings is populated based on SSRCs and RIDs present in the current remote
26 description, including SSRCs used for RTX and FEC, if signaled. Every member
27 of the RTCRtpEncodingParameters dictionaries other than the SSRC and RID fields
28 is left undefined.
29
30 - The headerExtensions sequence is populated based on the header extensions that
31 the receiver is currently prepared to receive.
32
33 - The codecs sequence is populated based on the codecs that the receiver is currently
34 prepared to receive.
35
36 - rtcp.reducedSize is set to true if the receiver is currently prepared to receive
37 reduced-size RTCP packets, and false otherwise. rtcp.cname is left undefined.
38
39 - transactionId and degradationPreference are left undefined.
40 */
41 test(t => {
42 const pc = new RTCPeerConnection();
43 const { receiver } = pc.addTransceiver('audio');
44 const param = pc.getParameters();
45 validateReceiverRtpParameters(param);
46 });
47</script>