Skip to content

Commit 0b02797

Browse files
padenotmoz-wptsync-bot
authored andcommitted
Explicitly test in WPT that AudioWorkletProcessor can have no parameterDescriptor getters.
This was implicitely tested before, but has its place in this new test. Differential Revision: https://phabricator.services.mozilla.com/D65155 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1565464 gecko-commit: 20e21af0f1e120901102224474fa308cbb570f54 gecko-integration-branch: autoland gecko-reviewers: karlt
1 parent cf4d073 commit 0b02797

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

webaudio/the-audio-api/the-audioworklet-interface/audioworklet-audioparam-iterable.https.html

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
];
4141
</script>
4242
<script id="processors" type="worklet">
43-
4443
registerProcessor("set",
4544
class SetParamProcessor extends AudioWorkletProcessor {
4645
static get parameterDescriptors() {
@@ -96,6 +95,16 @@
9695
throw "This should be TypeError";
9796
}
9897
}
98+
// Test a processor that has a no get parameterDescriptors.
99+
try {
100+
registerProcessor("no-params",
101+
class NoParamProcessor extends AudioWorkletProcessor {
102+
constructor() { super(); }
103+
process() { }
104+
});
105+
} catch (e) {
106+
throw "Construction should have worked.";
107+
}
99108
</script>
100109
<script>
101110
setup({ explicit_done: true });
@@ -149,9 +158,14 @@
149158
}, `Attempting to create an AudioWorkletNode with an non
150159
iterable for parameter descriptor should not work`);
151160
})
152-
.then(function() {
153-
done();
154-
});
161+
.then(function() {
162+
test(() => {
163+
new AudioWorkletNode(ac, "no-params");
164+
}, `Attempting to create an AudioWorkletNode from a processor
165+
that does not have a parameterDescriptors getter should work`);
166+
}).then(function() {
167+
done();
168+
});
155169
</script>
156170
</body>
157171
</html>

0 commit comments

Comments
 (0)