test_dataChannel_dtlsVersions.html (948B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <script type="application/javascript" src="pc.js"></script> 5 </head> 6 <body> 7 <pre id="test"> 8 <script type="application/javascript"> 9 createHTML({ 10 bug: "1284103", 11 title: "Test basic data channel audio connection for supported DTLS versions" 12 }); 13 14 async function testDtlsVersion(options, version) { 15 await SpecialPowers.pushPrefEnv({ 16 set: [ 17 ["media.peerconnection.dtls.version.min", version], 18 ["media.peerconnection.dtls.version.max", version] 19 ] 20 }); 21 22 const test = new PeerConnectionTest(options); 23 addInitialDataChannel(test.chain); 24 test.setMediaConstraints([{audio: true}], [{audio: true}]); 25 26 await test.run(); 27 } 28 29 runNetworkTest(async (options) => { 30 // 770 = DTLS 1.0, 771 = DTLS 1.2, 772 = DTLS 1.3 31 for (var version = 770; version <= 772; version++) { 32 await testDtlsVersion(options, version); 33 } 34 }); 35 </script> 36 </pre> 37 </body> 38 </html>