| 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 |
| 200 task.done(); | 214 task.done(); |
| 201 }); | 215 }); |
| 202 | 216 |
| 203 audit.define('createAnalyser', (task, should) => { | 217 audit.define('createAnalyser', (task, should) => { |
| 204 // Analysers | 218 // Analysers |
| 205 node = context.createAnalyser(); | 219 node = context.createAnalyser(); |
| 206 // Invalid fftSize: IndexSizeError | 220 // Invalid fftSize: IndexSizeError |
| 207 shouldThrowAndBeUnchanged(should, node, 'fftSize', '42'); | 221 shouldThrowAndBeUnchanged(should, node, 'fftSize', '42'); |
| 208 shouldThrowAndBeUnchanged(should, node, 'fftSize', '16'); | 222 shouldThrowAndBeUnchanged(should, node, 'fftSize', '16'); |
| 209 should(() => node.fftSize = 32768, 'AnalyserNode.fftSize = 32768').notThrow(); | 223 should(() => node.fftSize = 32768, 'AnalyserNode.fftSize = 32768').notThrow(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 227 .throw(); | 241 .throw(); |
| 228 should( | 242 should( |
| 229 () => node.getFloatTimeDomainData(null), | 243 () => node.getFloatTimeDomainData(null), |
| 230 node.constructor.name + '.getFloatTimeDomainData(null)') | 244 node.constructor.name + '.getFloatTimeDomainData(null)') |
| 231 .throw(); | 245 .throw(); |
| 232 should( | 246 should( |
| 233 () => node.getByteTimeDomainData(null), | 247 () => node.getByteTimeDomainData(null), |
| 234 node.constructor.name + '.getByteTimeDomainData(null)') | 248 node.constructor.name + '.getByteTimeDomainData(null)') |
| 235 .throw(); | 249 .throw(); |
| 236 | 250 |
| 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 |
| 237 // AudioBuffers | 270 // AudioBuffers |
| 238 node = context.createBuffer(1, 1, context.sampleRate); | 271 node = context.createBuffer(1, 1, context.sampleRate); |
| 239 // Invalid channel index: IndexSizeError | 272 // Invalid channel index: IndexSizeError |
| 240 should( | 273 should( |
| 241 () => node.getChannelData(2), | 274 () => node.getChannelData(2), |
| 242 node.constructor.name + '.getChannelData(2)') | 275 node.constructor.name + '.getChannelData(2)') |
| 243 .throw(); | 276 .throw(); |
| 244 | 277 |
| 245 task.done(); | 278 task.done(); |
| 246 }); | 279 }); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 }); | 362 }); |
| 330 | 363 |
| 331 audit.define('audioparam', (task, should) => { | 364 audit.define('audioparam', (task, should) => { |
| 332 // AudioParams | 365 // AudioParams |
| 333 param = context.createGain().gain; | 366 param = context.createGain().gain; |
| 334 should( | 367 should( |
| 335 () => param.setValueCurveAtTime(null, 0, 0), | 368 () => param.setValueCurveAtTime(null, 0, 0), |
| 336 'param.setValueCurveAtTime(null, 0, 0)') | 369 'param.setValueCurveAtTime(null, 0, 0)') |
| 337 .throw(); | 370 .throw(); |
| 338 | 371 |
| 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 |
| 339 // exponentialRampToValue should throw only for "zero" target values. | 379 // exponentialRampToValue should throw only for "zero" target values. |
| 340 should( | 380 should( |
| 341 () => node.gain.exponentialRampToValueAtTime(-1, 0.1), | 381 () => node.gain.exponentialRampToValueAtTime(-1, 0.1), |
| 342 'node.gain.exponentialRampToValueAtTime(-1, 0.1)') | 382 'node.gain.exponentialRampToValueAtTime(-1, 0.1)') |
| 343 .notThrow(); | 383 .notThrow(); |
| 344 should( | 384 should( |
| 345 () => node.gain.exponentialRampToValueAtTime(0, 0.1), | 385 () => node.gain.exponentialRampToValueAtTime(0, 0.1), |
| 346 'node.gain.exponentialRampToValueAtTime(0, 0.1)') | 386 'node.gain.exponentialRampToValueAtTime(0, 0.1)') |
| 347 .throw(); | 387 .throw(); |
| 348 // 1e-100 is 0 when converted to a single precision float. | 388 // 1e-100 is 0 when converted to a single precision float. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 () => node.getFrequencyResponse( | 429 () => node.getFrequencyResponse( |
| 390 new Float32Array(1), null, new Float32Array(1)), | 430 new Float32Array(1), null, new Float32Array(1)), |
| 391 'node.getFrequencyResponse(new Float32Array(1), null, new Float32Array(1))
') | 431 'node.getFrequencyResponse(new Float32Array(1), null, new Float32Array(1))
') |
| 392 .throw(); | 432 .throw(); |
| 393 should( | 433 should( |
| 394 () => node.getFrequencyResponse( | 434 () => node.getFrequencyResponse( |
| 395 new Float32Array(1), new Float32Array(1), null), | 435 new Float32Array(1), new Float32Array(1), null), |
| 396 'node.getFrequencyResponse(new Float32Array(1), new Float32Array(1), null)
') | 436 'node.getFrequencyResponse(new Float32Array(1), new Float32Array(1), null)
') |
| 397 .throw(); | 437 .throw(); |
| 398 | 438 |
| 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 |
| 399 task.done(); | 457 task.done(); |
| 400 }); | 458 }); |
| 401 | 459 |
| 402 audit.define('offline-audio-context', (task, should) => { | 460 audit.define('offline-audio-context', (task, should) => { |
| 403 // OfflineAudioContext | 461 // OfflineAudioContext |
| 404 // Max supported channels | 462 // Max supported channels |
| 405 should( | 463 should( |
| 406 () => new OfflineAudioContext(32, 100, context.sampleRate), | 464 () => new OfflineAudioContext(32, 100, context.sampleRate), |
| 407 'new OfflineAudioContext(32, 100, context.sampleRate)') | 465 'new OfflineAudioContext(32, 100, context.sampleRate)') |
| 408 .notThrow(); | 466 .notThrow(); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 should(source.noteOn, 'source.noteOn').beEqualTo(undefined); | 759 should(source.noteOn, 'source.noteOn').beEqualTo(undefined); |
| 702 should(source.noteOff, 'source.noteOff').beEqualTo(undefined); | 760 should(source.noteOff, 'source.noteOff').beEqualTo(undefined); |
| 703 | 761 |
| 704 task.done(); | 762 task.done(); |
| 705 }); | 763 }); |
| 706 | 764 |
| 707 audit.run(); | 765 audit.run(); |
| 708 </script> | 766 </script> |
| 709 </body> | 767 </body> |
| 710 </html> | 768 </html> |
| OLD | NEW |