Index: third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html |
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html |
index 111fa56b9a09b889dab524ff96299e63b01d9f7b..ed33381a211728d5f4ff028bdf248372f8297406 100644 |
--- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html |
+++ b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html |
@@ -1,82 +1,79 @@ |
<!DOCTYPE html> |
<html> |
- |
-<head> |
- <script src="../../resources/testharness.js"></script> |
- <script src="../../resources/testharnessreport.js"></script> |
- <script src="../resources/audit-util.js"></script> |
- <script src="../resources/audit.js"></script> |
- <script src="../resources/merger-testing.js"></script> |
-</head> |
- |
-<body> |
- <script> |
- |
- var audit = Audit.createTaskRunner(); |
- |
- |
- // Task: Check if an inactive input renders a silent mono channel in the |
- // output. |
- audit.define('silent-channel', (task, should) => { |
- testMergerInput(should, { |
- numberOfChannels: 7, |
- |
- // Create a mono source buffer filled with '1'. |
- testBufferContent: [1], |
- |
- // Connect the output of source into the 7th input of merger. |
- mergerInputIndex: 6, |
- |
- // 7th channel should be '1'. |
- expected: [0, 0, 0, 0, 0, 0, 1], |
- }) |
- .then(() => task.done()); |
- }); |
- |
- |
- // Task: Check if a stereo input is being down-mixed to mono channel |
- // correctly based on the mixing rule. |
- audit.define('stereo-down-mixing', (task, should) => { |
- testMergerInput(should, { |
- numberOfChannels: 7, |
- |
- // Create a stereo buffer filled with '1' and '2' for left and right |
- // channels respectively. |
- testBufferContent: [1, 2], |
- |
- // Connect the output of source into the 7th input of merger. |
- mergerInputIndex: 6, |
- |
- // The result of summed and down-mixed stereo audio should be 1.5. |
- // (= 1 * 0.5 + 2 * 0.5) |
- expected: [0, 0, 0, 0, 0, 0, 1.5], |
- }) |
- .then(() => task.done()); |
- }); |
- |
- |
- // Task: Check if 3-channel input gets processed by the 'discrete' mixing |
- // rule. |
- audit.define('undefined-channel-layout', (task, should) => { |
- testMergerInput(should, { |
- numberOfChannels: 7, |
- |
- // Create a 3-channel buffer filled with '1', '2', and '3' respectively. |
- testBufferContent: [1, 2, 3], |
- |
- // Connect the output of source into the 7th input of merger. |
- mergerInputIndex: 6, |
- |
- // The result of summed stereo audio should be 1 because 3-channel is |
- // not a canonical layout, so the input channel 2 and 3 should be |
- // dropped by 'discrete' mixing rule. |
- expected: [0, 0, 0, 0, 0, 0, 1], |
- }) |
- .then(() => task.done()); |
- }); |
- |
- audit.run(); |
- </script> |
-</body> |
- |
+ <head> |
+ <title> |
+ audiochannelmerger-input-non-default.html |
+ </title> |
+ <script src="../../resources/testharness.js"></script> |
+ <script src="../../resources/testharnessreport.js"></script> |
+ <script src="../resources/audit-util.js"></script> |
+ <script src="../resources/audit.js"></script> |
+ <script src="../resources/merger-testing.js"></script> |
+ </head> |
+ <body> |
+ <script id="layout-test-code"> |
+ let audit = Audit.createTaskRunner(); |
+ |
+ |
+ // Task: Check if an inactive input renders a silent mono channel in the |
+ // output. |
+ audit.define('silent-channel', (task, should) => { |
+ testMergerInput(should, { |
+ numberOfChannels: 7, |
+ |
+ // Create a mono source buffer filled with '1'. |
+ testBufferContent: [1], |
+ |
+ // Connect the output of source into the 7th input of merger. |
+ mergerInputIndex: 6, |
+ |
+ // 7th channel should be '1'. |
+ expected: [0, 0, 0, 0, 0, 0, 1], |
+ }).then(() => task.done()); |
+ }); |
+ |
+ |
+ // Task: Check if a stereo input is being down-mixed to mono channel |
+ // correctly based on the mixing rule. |
+ audit.define('stereo-down-mixing', (task, should) => { |
+ testMergerInput(should, { |
+ numberOfChannels: 7, |
+ |
+ // Create a stereo buffer filled with '1' and '2' for left and right |
+ // channels respectively. |
+ testBufferContent: [1, 2], |
+ |
+ // Connect the output of source into the 7th input of merger. |
+ mergerInputIndex: 6, |
+ |
+ // The result of summed and down-mixed stereo audio should be 1.5. |
+ // (= 1 * 0.5 + 2 * 0.5) |
+ expected: [0, 0, 0, 0, 0, 0, 1.5], |
+ }).then(() => task.done()); |
+ }); |
+ |
+ |
+ // Task: Check if 3-channel input gets processed by the 'discrete' mixing |
+ // rule. |
+ audit.define('undefined-channel-layout', (task, should) => { |
+ testMergerInput(should, { |
+ numberOfChannels: 7, |
+ |
+ // Create a 3-channel buffer filled with '1', '2', and '3' |
+ // respectively. |
+ testBufferContent: [1, 2, 3], |
+ |
+ // Connect the output of source into the 7th input of merger. |
+ mergerInputIndex: 6, |
+ |
+ // The result of summed stereo audio should be 1 because 3-channel is |
+ // not a canonical layout, so the input channel 2 and 3 should be |
+ // dropped by 'discrete' mixing rule. |
+ expected: [0, 0, 0, 0, 0, 0, 1], |
+ }).then(() => task.done()); |
+ }); |
+ |
+ audit.run(); |
+ </script> |
+ </body> |
</html> |