Index: third_party/WebKit/LayoutTests/webaudio/convolver-channels.html |
diff --git a/third_party/WebKit/LayoutTests/webaudio/convolver-channels.html b/third_party/WebKit/LayoutTests/webaudio/convolver-channels.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f80bc6c81fde37d07fcfcd7e11593e9054a72209 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/webaudio/convolver-channels.html |
@@ -0,0 +1,56 @@ |
+<!doctype html> |
+<html> |
+ <head> |
+ <script src="../resources/js-test.js"></script> |
+ <script src="resources/compatibility.js"></script> |
+ <script src="resources/audio-testing.js"></script> |
+ <title>Test Supported Number of Channels for ConvolverNode</title> |
+ </head> |
+ |
+ <body> |
+ <script> |
+ description("Test Supported Number of Channels for ConvolverNode"); |
+ window.jsTestIsAsync = true; |
+ |
+ var audit = Audit.createTaskRunner(); |
+ |
+ audit.defineTask("channel-count-test", function (done) { |
+ // Just need a context to create nodes on, so any allowed length and rate is ok. |
+ var context = new OfflineAudioContext(1, 1, 48000); |
+ |
+ var success = true; |
+ |
+ for (var count = 1; count <= 32; ++count) { |
+ var convolver = context.createConvolver(); |
+ var buffer = context.createBuffer(count, 1, context.sampleRate); |
+ var message = "ConvolverNode with buffer of " + count + " channels"; |
+ |
+ if (count == 1 || count == 2 || count == 4) { |
+ // These are the only valid channel counts for the buffer. |
+ success = Should(message, function () { |
+ convolver.buffer = buffer; |
+ }).notThrow() && success; |
+ } else { |
+ success = Should(message, function () { |
+ convolver.buffer = buffer; |
+ }).throw("NotSupportedError") && success; |
+ } |
+ } |
+ |
+ if (success) |
+ testPassed("Multiple channels for the convolver correctly handled."); |
+ else |
+ testFailed("Multiple channels for the convolver were not correctly handled."); |
+ |
+ done(); |
+ }); |
+ |
+ audit.defineTask("finish", function (done) { |
+ finishJSTest(); |
+ done(); |
+ }); |
+ |
+ audit.runTasks(); |
+ </script> |
+ </body> |
+</html> |