| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../resources/testharness.js"></script> | 4 <script src="../resources/testharness.js"></script> |
| 5 <script src="../resources/testharnessreport.js"></script> | 5 <script src="../resources/testharnessreport.js"></script> |
| 6 <script src="resources/audit-util.js"></script> | 6 <script src="resources/audit-util.js"></script> |
| 7 <script src="resources/audit.js"></script> | 7 <script src="resources/audit.js"></script> |
| 8 <script src="resources/biquad-testing.js"></script> | 8 <script src="resources/biquad-testing.js"></script> |
| 9 </head> | 9 </head> |
| 10 | 10 |
| 11 <body> | 11 <body> |
| 12 <script> | 12 <script> |
| 13 let audit = Audit.createTaskRunner(); | 13 let audit = Audit.createTaskRunner(); |
| 14 | 14 |
| 15 let otherContext; | 15 let otherContext; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 new Float32Array(10000), new Float32Array(10000)), | 190 new Float32Array(10000), new Float32Array(10000)), |
| 191 'context.createPeriodicWave(new Float32Array(10000), new Float32Array(1000
0))') | 191 'context.createPeriodicWave(new Float32Array(10000), new Float32Array(1000
0))') |
| 192 .notThrow(); | 192 .notThrow(); |
| 193 // Real and imaginary arrays must have the same size: IndexSizeError | 193 // Real and imaginary arrays must have the same size: IndexSizeError |
| 194 should( | 194 should( |
| 195 () => | 195 () => |
| 196 context.createPeriodicWave(new Float32Array(10), new Float32Array(7)), | 196 context.createPeriodicWave(new Float32Array(10), new Float32Array(7)), |
| 197 'context.createPeriodicWave(new Float32Array(10), new Float32Array(7))') | 197 'context.createPeriodicWave(new Float32Array(10), new Float32Array(7))') |
| 198 .throw('IndexSizeError'); | 198 .throw('IndexSizeError'); |
| 199 | 199 |
| 200 if (window.SharedArrayBuffer) { | |
| 201 let shared_view = new Float32Array(new SharedArrayBuffer(4100 * 4)); | |
| 202 let nonshared_view = new Float32Array(4100); | |
| 203 should( | |
| 204 () => context.createPeriodicWave(shared_view, nonshared_view), | |
| 205 'context.createPeriodicWave(shared_view, nonshared_view)') | |
| 206 .throw('TypeError'); | |
| 207 | |
| 208 should( | |
| 209 () => context.createPeriodicWave(nonshared_view, shared_view), | |
| 210 'context.createPeriodicWave(nonshared_view, shared_view)') | |
| 211 .throw('TypeError'); | |
| 212 } | |
| 213 | |
| 214 task.done(); | 200 task.done(); |
| 215 }); | 201 }); |
| 216 | 202 |
| 217 audit.define('createAnalyser', (task, should) => { | 203 audit.define('createAnalyser', (task, should) => { |
| 218 // Analysers | 204 // Analysers |
| 219 node = context.createAnalyser(); | 205 node = context.createAnalyser(); |
| 220 // Invalid fftSize: IndexSizeError | 206 // Invalid fftSize: IndexSizeError |
| 221 shouldThrowAndBeUnchanged(should, node, 'fftSize', '42'); | 207 shouldThrowAndBeUnchanged(should, node, 'fftSize', '42'); |
| 222 shouldThrowAndBeUnchanged(should, node, 'fftSize', '16'); | 208 shouldThrowAndBeUnchanged(should, node, 'fftSize', '16'); |
| 223 should(() => node.fftSize = 32768, 'AnalyserNode.fftSize = 32768').notThrow(); | 209 should(() => node.fftSize = 32768, 'AnalyserNode.fftSize = 32768').notThrow(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 241 .throw(); | 227 .throw(); |
| 242 should( | 228 should( |
| 243 () => node.getFloatTimeDomainData(null), | 229 () => node.getFloatTimeDomainData(null), |
| 244 node.constructor.name + '.getFloatTimeDomainData(null)') | 230 node.constructor.name + '.getFloatTimeDomainData(null)') |
| 245 .throw(); | 231 .throw(); |
| 246 should( | 232 should( |
| 247 () => node.getByteTimeDomainData(null), | 233 () => node.getByteTimeDomainData(null), |
| 248 node.constructor.name + '.getByteTimeDomainData(null)') | 234 node.constructor.name + '.getByteTimeDomainData(null)') |
| 249 .throw(); | 235 .throw(); |
| 250 | 236 |
| 251 if (window.SharedArrayBuffer) { | |
| 252 should( | |
| 253 () => node.getFloatFrequencyData(new Float32Array(new SharedArrayBuffer(
16))), | |
| 254 'AnalyserNode.getFloatFrequencyData(SharedArrayBuffer view)') | |
| 255 .throw(); | |
| 256 should( | |
| 257 () => node.getByteFrequencyData(new Uint8Array(new SharedArrayBuffer(16)
)), | |
| 258 node.constructor.name + '.getByteFrequencyData(SharedArrayBuffer view)') | |
| 259 .throw(); | |
| 260 should( | |
| 261 () => node.getFloatTimeDomainData(new Float32Array(new SharedArrayBuffer
(16))), | |
| 262 node.constructor.name + '.getFloatTimeDomainData(SharedArrayBuffer view)
') | |
| 263 .throw(); | |
| 264 should( | |
| 265 () => node.getByteTimeDomainData(new Uint8Array(new SharedArrayBuffer(16
))), | |
| 266 node.constructor.name + '.getByteTimeDomainData(SharedArrayBuffer view)'
) | |
| 267 .throw(); | |
| 268 } | |
| 269 | |
| 270 // AudioBuffers | 237 // AudioBuffers |
| 271 node = context.createBuffer(1, 1, context.sampleRate); | 238 node = context.createBuffer(1, 1, context.sampleRate); |
| 272 // Invalid channel index: IndexSizeError | 239 // Invalid channel index: IndexSizeError |
| 273 should( | 240 should( |
| 274 () => node.getChannelData(2), | 241 () => node.getChannelData(2), |
| 275 node.constructor.name + '.getChannelData(2)') | 242 node.constructor.name + '.getChannelData(2)') |
| 276 .throw(); | 243 .throw(); |
| 277 | 244 |
| 278 task.done(); | 245 task.done(); |
| 279 }); | 246 }); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 }); | 329 }); |
| 363 | 330 |
| 364 audit.define('audioparam', (task, should) => { | 331 audit.define('audioparam', (task, should) => { |
| 365 // AudioParams | 332 // AudioParams |
| 366 param = context.createGain().gain; | 333 param = context.createGain().gain; |
| 367 should( | 334 should( |
| 368 () => param.setValueCurveAtTime(null, 0, 0), | 335 () => param.setValueCurveAtTime(null, 0, 0), |
| 369 'param.setValueCurveAtTime(null, 0, 0)') | 336 'param.setValueCurveAtTime(null, 0, 0)') |
| 370 .throw(); | 337 .throw(); |
| 371 | 338 |
| 372 if (window.SharedArrayBuffer) { | |
| 373 should( | |
| 374 () => param.setValueCurveAtTime(new Float32Array(new SharedArrayBuffer(1
6)), 0, 0), | |
| 375 'param.setValueCurveAtTime(SharedArrayBuffer view, 0, 0)') | |
| 376 .throw(); | |
| 377 } | |
| 378 | |
| 379 // exponentialRampToValue should throw only for "zero" target values. | 339 // exponentialRampToValue should throw only for "zero" target values. |
| 380 should( | 340 should( |
| 381 () => node.gain.exponentialRampToValueAtTime(-1, 0.1), | 341 () => node.gain.exponentialRampToValueAtTime(-1, 0.1), |
| 382 'node.gain.exponentialRampToValueAtTime(-1, 0.1)') | 342 'node.gain.exponentialRampToValueAtTime(-1, 0.1)') |
| 383 .notThrow(); | 343 .notThrow(); |
| 384 should( | 344 should( |
| 385 () => node.gain.exponentialRampToValueAtTime(0, 0.1), | 345 () => node.gain.exponentialRampToValueAtTime(0, 0.1), |
| 386 'node.gain.exponentialRampToValueAtTime(0, 0.1)') | 346 'node.gain.exponentialRampToValueAtTime(0, 0.1)') |
| 387 .throw(); | 347 .throw(); |
| 388 // 1e-100 is 0 when converted to a single precision float. | 348 // 1e-100 is 0 when converted to a single precision float. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 () => node.getFrequencyResponse( | 389 () => node.getFrequencyResponse( |
| 430 new Float32Array(1), null, new Float32Array(1)), | 390 new Float32Array(1), null, new Float32Array(1)), |
| 431 'node.getFrequencyResponse(new Float32Array(1), null, new Float32Array(1))
') | 391 'node.getFrequencyResponse(new Float32Array(1), null, new Float32Array(1))
') |
| 432 .throw(); | 392 .throw(); |
| 433 should( | 393 should( |
| 434 () => node.getFrequencyResponse( | 394 () => node.getFrequencyResponse( |
| 435 new Float32Array(1), new Float32Array(1), null), | 395 new Float32Array(1), new Float32Array(1), null), |
| 436 'node.getFrequencyResponse(new Float32Array(1), new Float32Array(1), null)
') | 396 'node.getFrequencyResponse(new Float32Array(1), new Float32Array(1), null)
') |
| 437 .throw(); | 397 .throw(); |
| 438 | 398 |
| 439 if (window.SharedArrayBuffer) { | |
| 440 let shared_view = new Float32Array(new SharedArrayBuffer(4)); | |
| 441 let nonshared_view = new Float32Array(1); | |
| 442 | |
| 443 should( | |
| 444 () => node.getFrequencyResponse(shared_view, nonshared_view, nonshared_v
iew), | |
| 445 'node.getFrequencyResponse(shared_view, nonshared_view, nonshared_view)'
) | |
| 446 .throw(); | |
| 447 should( | |
| 448 () => node.getFrequencyResponse(nonshared_view, shared_view, nonshared_v
iew), | |
| 449 'node.getFrequencyResponse(nonshared_view, shared_view, nonshared_view)'
) | |
| 450 .throw(); | |
| 451 should( | |
| 452 () => node.getFrequencyResponse(nonshared_view, nonshared_view, shared_v
iew), | |
| 453 'node.getFrequencyResponse(nonshared_view, nonshared_view, shared_view)'
) | |
| 454 .throw(); | |
| 455 } | |
| 456 | |
| 457 task.done(); | 399 task.done(); |
| 458 }); | 400 }); |
| 459 | 401 |
| 460 audit.define('offline-audio-context', (task, should) => { | 402 audit.define('offline-audio-context', (task, should) => { |
| 461 // OfflineAudioContext | 403 // OfflineAudioContext |
| 462 // Max supported channels | 404 // Max supported channels |
| 463 should( | 405 should( |
| 464 () => new OfflineAudioContext(32, 100, context.sampleRate), | 406 () => new OfflineAudioContext(32, 100, context.sampleRate), |
| 465 'new OfflineAudioContext(32, 100, context.sampleRate)') | 407 'new OfflineAudioContext(32, 100, context.sampleRate)') |
| 466 .notThrow(); | 408 .notThrow(); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 should(source.noteOn, 'source.noteOn').beEqualTo(undefined); | 701 should(source.noteOn, 'source.noteOn').beEqualTo(undefined); |
| 760 should(source.noteOff, 'source.noteOff').beEqualTo(undefined); | 702 should(source.noteOff, 'source.noteOff').beEqualTo(undefined); |
| 761 | 703 |
| 762 task.done(); | 704 task.done(); |
| 763 }); | 705 }); |
| 764 | 706 |
| 765 audit.run(); | 707 audit.run(); |
| 766 </script> | 708 </script> |
| 767 </body> | 709 </body> |
| 768 </html> | 710 </html> |
| OLD | NEW |