diff options
Diffstat (limited to 'dom/media/webrtc/tests/mochitests/test_getUserMedia_nonDefaultRate.html')
-rw-r--r-- | dom/media/webrtc/tests/mochitests/test_getUserMedia_nonDefaultRate.html | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/dom/media/webrtc/tests/mochitests/test_getUserMedia_nonDefaultRate.html b/dom/media/webrtc/tests/mochitests/test_getUserMedia_nonDefaultRate.html new file mode 100644 index 0000000000..8a6ac8c62b --- /dev/null +++ b/dom/media/webrtc/tests/mochitests/test_getUserMedia_nonDefaultRate.html @@ -0,0 +1,37 @@ +<!DOCTYPE HTML> +<html> +<head> + <script type="application/javascript" src="mediaStreamPlayback.js"></script> +</head> +<body> +<pre id="test"> +<script type="application/javascript"> + createHTML({ + title: "getUserMedia feed to a graph with non default rate", + bug: "1387454", + }); + + /** + * Run a test to verify that when we use the streem from a gUM to an AudioContext + * with non default rate the connection fails. (gUM is always on default rate). + */ + runTest(async () => { + // Since we do not examine the stream we do not need loopback. + DISABLE_LOOPBACK_TONE = true; + const stream = await getUserMedia({audio: true}); + const nonDefaultRate = 32000; + const ac = new AudioContext({sampleRate: nonDefaultRate}); + mustThrowWith( + "Connect stream with graph of different sample rate", + "NotSupportedError", () => { + ac.createMediaStreamSource(stream); + } + ); + for (let t of stream.getTracks()) { + t.stop(); + } + }); +</script> +</pre> +</body> +</html> |