Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/convolver-channels.html

Issue 1497803002: Throw exceptions for invalid number of channels for ConvolverNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/convolver-channels-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/convolver-channels-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698