File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
webaudio/the-audio-api/the-audioworklet-interface Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 40
40
] ;
41
41
</ script >
42
42
< script id ="processors " type ="worklet ">
43
-
44
43
registerProcessor ( "set" ,
45
44
class SetParamProcessor extends AudioWorkletProcessor {
46
45
static get parameterDescriptors ( ) {
96
95
throw "This should be TypeError" ;
97
96
}
98
97
}
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
+ }
99
108
</ script >
100
109
< script >
101
110
setup ( { explicit_done : true } ) ;
149
158
} , `Attempting to create an AudioWorkletNode with an non
150
159
iterable for parameter descriptor should not work` ) ;
151
160
} )
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
+ } ) ;
155
169
</ script >
156
170
</ body >
157
171
</ html >
You can’t perform that action at this time.
0 commit comments