summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html')
-rw-r--r--testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html51
1 files changed, 51 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html b/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html
new file mode 100644
index 0000000000..ce2d5fcfe9
--- /dev/null
+++ b/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>
+ convolver-setBuffer-already-has-value.html
+ </title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/webaudio/resources/audit.js"></script>
+ </head>
+ <body>
+ <script id="layout-test-code">
+ let audit = Audit.createTaskRunner();
+
+ audit.define('test', (task, should) => {
+ let context = new AudioContext();
+ let audioBuffer = new AudioBuffer(
+ {numberOfChannels: 1, length: 1, sampleRate: context.sampleRate});
+ let convolver = context.createConvolver();
+ should(() => {
+ convolver.buffer = null;
+ }, 'Set buffer to null before set non-null').notThrow();
+
+ should(() => {
+ convolver.buffer = audioBuffer;
+ }, 'Set buffer first normally').notThrow();
+
+ should(() => {
+ convolver.buffer = audioBuffer;
+ }, 'Set buffer a second time').notThrow();
+
+ should(() => {
+ convolver.buffer = null;
+ }, 'Set buffer to null').notThrow();
+
+ should(() => {
+ convolver.buffer = null;
+ }, 'Set buffer to null again, to make sure').notThrow();
+
+ should(() => {
+ convolver.buffer = audioBuffer;
+ }, 'Set buffer to non-null to verify it is set')
+ .notThrow();
+
+ task.done();
+ });
+
+ audit.run();
+ </script>
+ </body>
+</html>