diff options
Diffstat (limited to 'testing/web-platform/tests/webrtc-extensions')
4 files changed, 0 insertions, 236 deletions
diff --git a/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-audio-jitterBufferTarget-stats.https.html b/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-audio-jitterBufferTarget-stats.https.html deleted file mode 100644 index d728ec5a9c..0000000000 --- a/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-audio-jitterBufferTarget-stats.https.html +++ /dev/null @@ -1,18 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<meta name="timeout" content="long"> -<title>Tests RTCRtpReceiver-jitterBufferTarget verified with stats</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/webrtc/RTCPeerConnection-helper.js"></script> -<script src="/webrtc-extensions/RTCRtpReceiver-jitterBufferTarget-stats-helper.js"></script> -<body> -<script> -'use strict' - -promise_test(async t => { - await applyJitterBufferTarget(t, "audio", 300); -}, `measure raising and lowering audio jitterBufferTarget`); - -</script> -</body> diff --git a/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-jitterBufferTarget-stats-helper.js b/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-jitterBufferTarget-stats-helper.js deleted file mode 100644 index 31d80926d3..0000000000 --- a/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-jitterBufferTarget-stats-helper.js +++ /dev/null @@ -1,70 +0,0 @@ -async function measureDelayFromStats(t, receiver, cycles, targetDelay, tolerance) { - let oldInboundStats; - - for (let i = 0; i < cycles; i++) { - const statsReport = await receiver.getStats(); - const inboundStats = [...statsReport.values()].find(({type}) => type == "inbound-rtp"); - - if (inboundStats) { - if (oldInboundStats) { - const emittedCount = inboundStats.jitterBufferEmittedCount - oldInboundStats.jitterBufferEmittedCount; - - if (emittedCount) { - const delay = 1000 * (inboundStats.jitterBufferDelay - oldInboundStats.jitterBufferDelay) / emittedCount; - - if (Math.abs(delay - targetDelay) < tolerance) { - return true; - } - } - } - oldInboundStats = inboundStats; - } - await new Promise(r => t.step_timeout(r, 1000)); - } - - return false; -} - -async function applyJitterBufferTarget(t, kind, target) { - const caller = new RTCPeerConnection(); - t.add_cleanup(() => caller.close()); - const callee = new RTCPeerConnection(); - t.add_cleanup(() => callee.close()); - - const stream = await getNoiseStream({[kind]:true}); - t.add_cleanup(() => stream.getTracks().forEach(track => track.stop())); - caller.addTransceiver(stream.getTracks()[0], {streams: [stream]}); - - exchangeIceCandidates(caller, callee); - await exchangeOffer(caller, callee); - await exchangeAnswer(caller, callee); - - const receiver = callee.getReceivers()[0]; - - // Workaround for Chromium to pull audio from jitter buffer. - if (kind === "audio") { - const audio = document.createElement("audio"); - - audio.srcObject = new MediaStream([receiver.track]); - audio.play(); - } - assert_equals(receiver.jitterBufferTarget, null, - `jitterBufferTarget supported for ${kind}`); - - let result = await measureDelayFromStats(t, receiver, 5, 0, 100); - assert_true(result, 'jitter buffer is not stabilised'); - - receiver.jitterBufferTarget = target; - assert_equals(receiver.jitterBufferTarget, target, - `jitterBufferTarget increase target for ${kind}`); - - result = await measureDelayFromStats(t, receiver, 10, target, 20); - assert_true(result, 'jitterBuffer does not reach target'); - - receiver.jitterBufferTarget = 0; - assert_equals(receiver.jitterBufferTarget, 0, - `jitterBufferTarget decrease target for ${kind}`); - - result = await measureDelayFromStats(t, receiver, 10, 0, 100); - assert_true(result, 'jitter buffer delay is not back to normal'); -} diff --git a/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-jitterBufferTarget.html b/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-jitterBufferTarget.html deleted file mode 100644 index 448162d3a2..0000000000 --- a/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-jitterBufferTarget.html +++ /dev/null @@ -1,130 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>Tests for RTCRtpReceiver-jitterBufferTarget attribute</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<body> -<script> -'use strict' - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('audio', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); -}, 'audio jitterBufferTarget is null by default'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('audio', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); - receiver.jitterBufferTarget = 500; - assert_equals(receiver.jitterBufferTarget, 500); -}, 'audio jitterBufferTarget accepts posititve values'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('audio', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); - receiver.jitterBufferTarget = 4000; - assert_throws_js(RangeError, () => { - receiver.jitterBufferTarget = 4001; - }, 'audio jitterBufferTarget doesn\'t accept values greater than 4000 milliseconds'); - assert_equals(receiver.jitterBufferTarget, 4000); -}, 'audio jitterBufferTarget accepts values up to 4000 milliseconds'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('audio', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); - receiver.jitterBufferTarget = 700; - assert_throws_js(RangeError, () => { - receiver.jitterBufferTarget = -500; - }, 'audio jitterBufferTarget doesn\'t accept negative values'); - assert_equals(receiver.jitterBufferTarget, 700); -}, 'audio jitterBufferTarget returns last valid value on throw'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('audio', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); - receiver.jitterBufferTarget = 0; - assert_equals(receiver.jitterBufferTarget, 0); -}, 'audio jitterBufferTarget allows zero value'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('audio', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); - receiver.jitterBufferTarget = 500; - assert_equals(receiver.jitterBufferTarget, 500); - receiver.jitterBufferTarget = null; - assert_equals(receiver.jitterBufferTarget, null); -}, 'audio jitterBufferTarget allows to reset value to null'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('video', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); -}, 'video jitterBufferTarget is null by default'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('video', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); - receiver.jitterBufferTarget = 500; - assert_equals(receiver.jitterBufferTarget, 500); -}, 'video jitterBufferTarget accepts posititve values'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('video', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); - receiver.jitterBufferTarget = 4000; - assert_throws_js(RangeError, () => { - receiver.jitterBufferTarget = 4001; - }, 'video jitterBufferTarget doesn\'t accept values greater than 4000 milliseconds'); - assert_equals(receiver.jitterBufferTarget, 4000); -}, 'video jitterBufferTarget accepts values up to 4000 milliseconds'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('video', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); - receiver.jitterBufferTarget = 700; - assert_throws_js(RangeError, () => { - receiver.jitterBufferTarget = -500; - }, 'video jitterBufferTarget doesn\'t accept negative values'); - assert_equals(receiver.jitterBufferTarget, 700); -}, 'video jitterBufferTarget returns last valid value'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('video', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); - receiver.jitterBufferTarget = 0; - assert_equals(receiver.jitterBufferTarget, 0); -}, 'video jitterBufferTarget allows zero value'); - -test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const {receiver} = pc.addTransceiver('video', {direction:'recvonly'}); - assert_equals(receiver.jitterBufferTarget, null); - receiver.jitterBufferTarget = 500; - assert_equals(receiver.jitterBufferTarget, 500); - receiver.jitterBufferTarget = null; - assert_equals(receiver.jitterBufferTarget, null); -}, 'video jitterBufferTarget allows to reset value to null'); -</script> -</body> diff --git a/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-video-jitterBufferTarget-stats.html b/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-video-jitterBufferTarget-stats.html deleted file mode 100644 index 022dbe70c5..0000000000 --- a/testing/web-platform/tests/webrtc-extensions/RTCRtpReceiver-video-jitterBufferTarget-stats.html +++ /dev/null @@ -1,18 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<meta name="timeout" content="long"> -<title>Tests RTCRtpReceiver-jitterBufferTarget verified with stats</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/webrtc/RTCPeerConnection-helper.js"></script> -<script src="/webrtc-extensions/RTCRtpReceiver-jitterBufferTarget-stats-helper.js"></script> -<body> -<script> -'use strict' - -promise_test(async t => { - await applyJitterBufferTarget(t, "video", 1000); -}, `measure raising and lowering video jitterBufferTarget`); - -</script> -</body> |