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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/resources/merger-testing.js

Issue 2781123002: Convert ChannelMerger tests to new Audit (Closed)
Patch Set: 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 | « third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html ('k') | 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 // This file is for the audiochannelmerger-* layout tests. 1 // This file is for the audiochannelmerger-* layout tests.
2 // Requires |audio-testing.js| to work properly. 2 // Requires |audio-testing.js| to work properly.
3 3
4 function testMergerInput(config, done) { 4 function testMergerInput(should, config) {
5 var context = new OfflineAudioContext(config.numberOfChannels, 128, 44100); 5 var context = new OfflineAudioContext(config.numberOfChannels, 128, 44100);
6 var merger = context.createChannelMerger(config.numberOfChannels); 6 var merger = context.createChannelMerger(config.numberOfChannels);
7 var source = context.createBufferSource(); 7 var source = context.createBufferSource();
8 source.buffer = createConstantBuffer(context, 128, config.testBufferContent); 8 source.buffer = createConstantBuffer(context, 128, config.testBufferContent);
9 9
10 // Connect the output of source into the specified input of merger. 10 // Connect the output of source into the specified input of merger.
11 if (config.mergerInputIndex) 11 if (config.mergerInputIndex)
12 source.connect(merger, 0, config.mergerInputIndex); 12 source.connect(merger, 0, config.mergerInputIndex);
13 else 13 else
14 source.connect(merger); 14 source.connect(merger);
15 merger.connect(context.destination); 15 merger.connect(context.destination);
16 source.start(); 16 source.start();
17 17
18 context.startRendering().then(function (buffer) { 18 return context.startRendering().then(function (buffer) {
19 let prefix = config.testBufferContent.length + '-channel source: '; 19 let prefix = config.testBufferContent.length + '-channel source: ';
20 for (var i = 0; i < config.numberOfChannels; i++) 20 for (var i = 0; i < config.numberOfChannels; i++)
21 Should(prefix + 'Channel #' + i, buffer.getChannelData(i)) 21 should(buffer.getChannelData(i), prefix + 'Channel #' + i)
22 .beConstantValueOf(config.expected[i]); 22 .beConstantValueOf(config.expected[i]);
23 done();
24 }); 23 });
25 } 24 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698