diff options
Diffstat (limited to 'dom/media/webrtc/tests/mochitests/test_peerConnection_bug1512281.html')
-rw-r--r-- | dom/media/webrtc/tests/mochitests/test_peerConnection_bug1512281.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dom/media/webrtc/tests/mochitests/test_peerConnection_bug1512281.html b/dom/media/webrtc/tests/mochitests/test_peerConnection_bug1512281.html new file mode 100644 index 0000000000..e6451becea --- /dev/null +++ b/dom/media/webrtc/tests/mochitests/test_peerConnection_bug1512281.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML> +<html> +<head> + <script type="application/javascript" src="pc.js"></script> +</head> +<body> +<pre id="test"> +<script type="application/javascript"> + createHTML({ + bug: "1512281", + title: "Test that RTCP sender and receiver stats are not swapped" + }); + +const ensure_missing_rtcp = async stats => { + const rtcp_stats = [...stats.values()].filter( + s => s.type.endsWith("bound-rtp") && + s.isRemote == true).map(s => JSON.stringify(s)) + is(rtcp_stats, [], + "There are no RTCP stats when RTCP reception is turned off"); +}; + +const PC_LOCAL_TEST_FOR_MISSING_RTCP = async test => + await ensure_missing_rtcp(await test.pcLocal.getStats()); + +const PC_REMOTE_TEST_FOR_MISSING_RTCP = async test => + await ensure_missing_rtcp(await test.pcRemote.getStats()); + +runNetworkTest(async options => { + await pushPrefs(["media.webrtc.net.force_disable_rtcp_reception", true]); + + const test = new PeerConnectionTest(options); + + test.chain.insertAfter("PC_LOCAL_WAIT_FOR_MEDIA_FLOW", + [PC_LOCAL_TEST_FOR_MISSING_RTCP]); + + test.chain.insertAfter("PC_REMOTE_WAIT_FOR_MEDIA_FLOW", + [PC_REMOTE_TEST_FOR_MISSING_RTCP]); + + test.setMediaConstraints([{audio: true}, {video: true}], + [{audio: true}, {video: true}]); + await test.run(); +}); + +</script> +</pre> +</body> +</html> |