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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="resources/compatibility.js"></script>
6 <script src="resources/audio-testing.js"></script>
7 <title>Test Supported Number of Channels for ConvolverNode</title>
8 </head>
9
10 <body>
11 <script>
12 description("Test Supported Number of Channels for ConvolverNode");
13 window.jsTestIsAsync = true;
14
15 var audit = Audit.createTaskRunner();
16
17 audit.defineTask("channel-count-test", function (done) {
18 // Just need a context to create nodes on, so any allowed length and rat e is ok.
19 var context = new OfflineAudioContext(1, 1, 48000);
20
21 var success = true;
22
23 for (var count = 1; count <= 32; ++count) {
24 var convolver = context.createConvolver();
25 var buffer = context.createBuffer(count, 1, context.sampleRate);
26 var message = "ConvolverNode with buffer of " + count + " channels";
27
28 if (count == 1 || count == 2 || count == 4) {
29 // These are the only valid channel counts for the buffer.
30 success = Should(message, function () {
31 convolver.buffer = buffer;
32 }).notThrow() && success;
33 } else {
34 success = Should(message, function () {
35 convolver.buffer = buffer;
36 }).throw("NotSupportedError") && success;
37 }
38 }
39
40 if (success)
41 testPassed("Multiple channels for the convolver correctly handled.");
42 else
43 testFailed("Multiple channels for the convolver were not correctly han dled.");
44
45 done();
46 });
47
48 audit.defineTask("finish", function (done) {
49 finishJSTest();
50 done();
51 });
52
53 audit.runTasks();
54 </script>
55 </body>
56 </html>
OLDNEW
« 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