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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/Convolver/convolver-channels.html

Issue 2799763002: Convert Convolver tests to new Audit (Closed)
Patch Set: Address review comments Created 3 years, 8 months 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/audio-testing.js"></script> 7 <script src="../resources/audit.js"></script>
8 <title>Test Supported Number of Channels for ConvolverNode</title> 8 <title>Test Supported Number of Channels for ConvolverNode</title>
9 </head> 9 </head>
10 10
11 <body> 11 <body>
12 <script> 12 <script>
13 13
14 var audit = Audit.createTaskRunner(); 14 var audit = Audit.createTaskRunner();
15 15
16 audit.defineTask("channel-count-test", function (done) { 16 audit.define("channel-count-test", (task, should) => {
17 // Just need a context to create nodes on, so any allowed length and rat e is ok. 17 // Just need a context to create nodes on, so any allowed length and rat e is ok.
18 var context = new OfflineAudioContext(1, 1, 48000); 18 var context = new OfflineAudioContext(1, 1, 48000);
19 19
20 var success = true; 20 var success = true;
21 21
22 for (var count = 1; count <= 32; ++count) { 22 for (var count = 1; count <= 32; ++count) {
23 var convolver = context.createConvolver(); 23 var convolver = context.createConvolver();
24 var buffer = context.createBuffer(count, 1, context.sampleRate); 24 var buffer = context.createBuffer(count, 1, context.sampleRate);
25 var message = "ConvolverNode with buffer of " + count + " channels"; 25 var message = "ConvolverNode with buffer of " + count + " channels";
26 26
27 if (count == 1 || count == 2 || count == 4) { 27 if (count == 1 || count == 2 || count == 4) {
28 // These are the only valid channel counts for the buffer. 28 // These are the only valid channel counts for the buffer.
29 success = Should(message, function () { 29 should(() => convolver.buffer = buffer, message)
30 convolver.buffer = buffer; 30 .notThrow();
31 }).notThrow() && success;
32 } else { 31 } else {
33 success = Should(message, function () { 32 should(() => convolver.buffer = buffer, message)
34 convolver.buffer = buffer; 33 .throw("NotSupportedError");
35 }).throw("NotSupportedError") && success;
36 } 34 }
37 } 35 }
38 36
39 Should("Multiple channels for the convolver were handled", success) 37 task.done();
40 .summarize("correctly", "incorrectly");
41
42 done();
43 }); 38 });
44 39
45 audit.defineTask("finish", function (done) { 40 audit.run();
46 done();
47 });
48
49 audit.runTasks();
50 </script> 41 </script>
51 </body> 42 </body>
52 </html> 43 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698