Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / webaudio / audiochannelmerger-input-non-default.html
blob7a87880ab45f7347d604b3e7920996c0b0ca1819
1 <!DOCTYPE html>
2 <html>
4 <head>
5 <script src="../resources/js-test.js"></script>
6 <script src="resources/compatibility.js"></script>
7 <script src="resources/audio-testing.js"></script>
8 <script src="resources/merger-testing.js"></script>
9 </head>
11 <body>
12 <script>
13 description('Test input handling of ChannelMergerNode (non-default).');
14 window.jsTestIsAsync = true;
16 var audit = Audit.createTaskRunner();
19 // Task: Check if an inactive input renders a silent mono channel in the
20 // output.
21 audit.defineTask('silent-channel', function (done) {
22 testMergerInput({
23 numberOfChannels: 7,
25 // Create a mono source buffer filled with '1'.
26 testBufferChannelCount: 1,
28 // Connect the output of source into the 7th input of merger.
29 mergerInputIndex: 6,
31 // 7th channel should be '1'.
32 expected: [0, 0, 0, 0, 0, 0, 1],
33 }, done);
34 });
37 // Task: Check if a stereo input is being down-mixed to mono channel
38 // correctly based on the mixing rule.
39 audit.defineTask('stereo-down-mixing', function (done) {
40 testMergerInput({
41 numberOfChannels: 7,
43 // Create a stereo buffer filled with '1' and '2' for left and right
44 // channels respectively.
45 testBufferChannelCount: 2,
47 // Connect the output of source into the 7th input of merger.
48 mergerInputIndex: 6,
50 // The result of summed and down-mixed stereo audio should be 1.5.
51 // (= 1 * 0.5 + 2 * 0.5)
52 expected: [0, 0, 0, 0, 0, 0, 1.5],
53 }, done);
54 });
57 // Task: Check if 3-channel input gets processed by the 'discrete' mixing
58 // rule.
59 audit.defineTask('undefined-channel-layout', function (done) {
60 testMergerInput({
61 numberOfChannels: 7,
63 // Create a 3-channel buffer filled with '1', '2', and '3' respectively.
64 testBufferChannelCount: 3,
66 // Connect the output of source into the 7th input of merger.
67 mergerInputIndex: 6,
69 // The result of summed stereo audio should be 1 because 3-channel is
70 // not a canonical layout, so the input channel 2 and 3 should be
71 // dropped by 'discrete' mixing rule.
72 expected: [0, 0, 0, 0, 0, 0, 1],
73 }, done);
74 });
76 audit.defineTask('finish', function (done) {
77 finishJSTest();
78 done();
79 });
81 audit.runTasks(
82 'silent-channel',
83 'stereo-down-mixing',
84 'undefined-channel-layout',
85 'finish'
88 successfullyParsed = true;
89 </script>
90 </body>
92 </html>