test_peerConnection_bug1512281.html (1310B)
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: "1512281", 11 title: "Test that RTCP sender and receiver stats are not swapped" 12 }); 13 14 const ensure_missing_rtcp = async stats => { 15 const rtcp_stats = [...stats.values()].filter( 16 s => s.type.endsWith("bound-rtp") && 17 s.isRemote == true).map(s => JSON.stringify(s)) 18 is(rtcp_stats, [], 19 "There are no RTCP stats when RTCP reception is turned off"); 20 }; 21 22 const PC_LOCAL_TEST_FOR_MISSING_RTCP = async test => 23 await ensure_missing_rtcp(await test.pcLocal.getStats()); 24 25 const PC_REMOTE_TEST_FOR_MISSING_RTCP = async test => 26 await ensure_missing_rtcp(await test.pcRemote.getStats()); 27 28 runNetworkTest(async options => { 29 await pushPrefs(["media.webrtc.net.force_disable_rtcp_reception", true]); 30 31 const test = new PeerConnectionTest(options); 32 33 test.chain.insertAfter("PC_LOCAL_WAIT_FOR_MEDIA_FLOW", 34 [PC_LOCAL_TEST_FOR_MISSING_RTCP]); 35 36 test.chain.insertAfter("PC_REMOTE_WAIT_FOR_MEDIA_FLOW", 37 [PC_REMOTE_TEST_FOR_MISSING_RTCP]); 38 39 test.setMediaConstraints([{audio: true}, {video: true}], 40 [{audio: true}, {video: true}]); 41 await test.run(); 42 }); 43 44 </script> 45 </pre> 46 </body> 47 </html>