diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/webaudio/the-audio-api/the-destinationnode-interface | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/webaudio/the-audio-api/the-destinationnode-interface')
-rw-r--r-- | testing/web-platform/tests/webaudio/the-audio-api/the-destinationnode-interface/destination.html | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-destinationnode-interface/destination.html b/testing/web-platform/tests/webaudio/the-audio-api/the-destinationnode-interface/destination.html new file mode 100644 index 0000000000..1af0e0f010 --- /dev/null +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-destinationnode-interface/destination.html @@ -0,0 +1,51 @@ +<!DOCTYPE html> +<html> + <head> + <title> + AudioDestinationNode + </title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <script> + function assert_doesnt_throw(f, desc) { + try { + f(); + } catch (e) { + assert_true(false, desc); + return; + } + assert_true(true, desc); + } + + test(function() { + var ac = new AudioContext(); + + assert_equals(ac.destination.channelCount, 2, + "A DestinationNode should have two channels by default"); + + assert_greater_than_equal(ac.destination.maxChannelCount, 2, + "maxChannelCount should be >= 2"); + + assert_throws_dom("IndexSizeError", function() { + ac.destination.channelCount = ac.destination.maxChannelCount + 1 + }, `Setting the channelCount to something greater than + the maxChannelCount should throw IndexSizeError`); + + assert_throws_dom("NotSupportedError", function() { + ac.destination.channelCount = 0; + }, "Setting the channelCount to 0 should throw NotSupportedError"); + + assert_doesnt_throw(function() { + ac.destination.channelCount = ac.destination.maxChannelCount; + }, "Setting the channelCount to maxChannelCount should not throw"); + + assert_doesnt_throw(function() { + ac.destination.channelCount = 1; + }, "Setting the channelCount to 1 should not throw"); + }); + + </script> + </body> +</html> |