RTCRtpReceiver-getCapabilities.html (1342B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <title>RTCRtpReceiver.getCapabilities</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="RTCRtpCapabilities-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 RTCRtpCapabilities-helper.js: 15 // validateRtpCapabilities 16 17 /* 18 5.3. RTCRtpReceiver Interface 19 interface RTCRtpReceiver { 20 ... 21 static RTCRtpCapabilities getCapabilities(DOMString kind); 22 }; 23 */ 24 test(() => { 25 const capabilities = RTCRtpReceiver.getCapabilities('audio'); 26 validateRtpCapabilities(capabilities); 27 }, `RTCRtpSender.getCapabilities('audio') should return RTCRtpCapabilities dictionary`); 28 29 test(() => { 30 const capabilities = RTCRtpReceiver.getCapabilities('video'); 31 validateRtpCapabilities(capabilities); 32 }, `RTCRtpSender.getCapabilities('video') should return RTCRtpCapabilities dictionary`); 33 34 test(() => { 35 const capabilities = RTCRtpReceiver.getCapabilities('dummy'); 36 assert_equals(capabilities, null); 37 }, `RTCRtpSender.getCapabilities('dummy') should return null`); 38 39 </script>