| OLD | NEW |
| 1 <!doctype html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title> |
| 5 Test Supported Number of Channels for ConvolverNode |
| 6 </title> |
| 4 <script src="../../resources/testharness.js"></script> | 7 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> | 8 <script src="../../resources/testharnessreport.js"></script> |
| 6 <script src="../resources/audit-util.js"></script> | 9 <script src="../resources/audit-util.js"></script> |
| 7 <script src="../resources/audit.js"></script> | 10 <script src="../resources/audit.js"></script> |
| 8 <title>Test Supported Number of Channels for ConvolverNode</title> | |
| 9 </head> | 11 </head> |
| 12 <body> |
| 13 <script id="layout-test-code"> |
| 14 let audit = Audit.createTaskRunner(); |
| 10 | 15 |
| 11 <body> | 16 audit.define('channel-count-test', (task, should) => { |
| 12 <script> | 17 // Just need a context to create nodes on, so any allowed length and |
| 18 // rate is ok. |
| 19 let context = new OfflineAudioContext(1, 1, 48000); |
| 13 | 20 |
| 14 var audit = Audit.createTaskRunner(); | 21 let success = true; |
| 15 | 22 |
| 16 audit.define("channel-count-test", (task, should) => { | 23 for (let count = 1; count <= 32; ++count) { |
| 17 // Just need a context to create nodes on, so any allowed length and rat
e is ok. | 24 let convolver = context.createConvolver(); |
| 18 var context = new OfflineAudioContext(1, 1, 48000); | 25 let buffer = context.createBuffer(count, 1, context.sampleRate); |
| 19 | 26 let message = 'ConvolverNode with buffer of ' + count + ' channels'; |
| 20 var success = true; | |
| 21 | |
| 22 for (var count = 1; count <= 32; ++count) { | |
| 23 var convolver = context.createConvolver(); | |
| 24 var buffer = context.createBuffer(count, 1, context.sampleRate); | |
| 25 var message = "ConvolverNode with buffer of " + count + " channels"; | |
| 26 | 27 |
| 27 if (count == 1 || count == 2 || count == 4) { | 28 if (count == 1 || count == 2 || count == 4) { |
| 28 // These are the only valid channel counts for the buffer. | 29 // These are the only valid channel counts for the buffer. |
| 29 should(() => convolver.buffer = buffer, message) | 30 should(() => convolver.buffer = buffer, message).notThrow(); |
| 30 .notThrow(); | |
| 31 } else { | 31 } else { |
| 32 should(() => convolver.buffer = buffer, message) | 32 should(() => convolver.buffer = buffer, message) |
| 33 .throw("NotSupportedError"); | 33 .throw('NotSupportedError'); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 task.done(); | 37 task.done(); |
| 38 }); | 38 }); |
| 39 | 39 |
| 40 audit.run(); | 40 audit.run(); |
| 41 </script> | 41 </script> |
| 42 </body> | 42 </body> |
| 43 </html> | 43 </html> |
| OLD | NEW |