Index: third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input.html |
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input.html b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input.html |
index 4031f9057e75a69158bf941e4f1126fdeb48de94..1cf66e2354b3b64c719bf7430b604f5e6e25be44 100644 |
--- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input.html |
+++ b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input.html |
@@ -5,7 +5,7 @@ |
<script src="../../resources/testharness.js"></script> |
<script src="../../resources/testharnessreport.js"></script> |
<script src="../resources/audit-util.js"></script> |
- <script src="../resources/audio-testing.js"></script> |
+ <script src="../resources/audit.js"></script> |
<script src="../resources/merger-testing.js"></script> |
</head> |
@@ -16,8 +16,8 @@ |
// Task: Check if an inactive input renders a silent mono channel in the |
// output. |
- audit.defineTask('silent-channel', function (done) { |
- testMergerInput({ |
+ audit.define('silent-channel', (task, should) => { |
+ testMergerInput(should, { |
numberOfChannels: 6, |
// Create a mono source buffer filled with '1'. |
@@ -28,14 +28,15 @@ |
// All channels should contain 0, except channel 4 which should be 1. |
expected: [0, 0, 0, 1, 0, 0], |
- }, done); |
+ }) |
+ .then(() => task.done()); |
}); |
// Task: Check if a stereo input is being down-mixed to mono channel |
// correctly based on the mixing rule. |
- audit.defineTask('stereo-down-mixing', function (done) { |
- testMergerInput({ |
+ audit.define('stereo-down-mixing', (task, should) => { |
+ testMergerInput(should, { |
numberOfChannels: 6, |
// Create a stereo buffer filled with '1' and '2' for left and right |
@@ -48,14 +49,15 @@ |
// The result of summed and down-mixed stereo audio should be 1.5. |
// (= 1 * 0.5 + 2 * 0.5) |
expected: [1.5, 0, 0, 0, 0, 0], |
- }, done); |
+ }) |
+ .then(() => task.done()); |
}); |
// Task: Check if 3-channel input gets processed by the 'discrete' mixing |
// rule. |
- audit.defineTask('undefined-channel-layout', function (done) { |
- testMergerInput({ |
+ audit.define('undefined-channel-layout', (task, should) => { |
+ testMergerInput(should, { |
numberOfChannels: 6, |
// Create a 3-channel buffer filled with '1', '2', and '3' respectively. |
@@ -68,12 +70,13 @@ |
// not a canonical layout, so the input channel 2 and 3 should be |
// dropped by 'discrete' mixing rule. |
expected: [1, 0, 0, 0, 0, 0], |
- }, done); |
+ }) |
+ .then(() => task.done()); |
}); |
// Task: Merging two inputs into a single stereo stream. |
- audit.defineTask('merging-to-stereo', function (done) { |
+ audit.define('merging-to-stereo', (task, should) => { |
// For this test, the number of channel should be 2. |
var context = new OfflineAudioContext(2, 128, 44100); |
@@ -98,27 +101,15 @@ |
context.startRendering().then(function (buffer) { |
// Channel#0 = 1, Channel#1 = -1 |
- Should('Channel #0', buffer.getChannelData(0)).beConstantValueOf(1); |
- Should('Channel #1', buffer.getChannelData(1)).beConstantValueOf(-1); |
+ should(buffer.getChannelData(0), 'Channel #0').beConstantValueOf(1); |
+ should(buffer.getChannelData(1), 'Channel #1').beConstantValueOf(-1); |
- done(); |
+ task.done(); |
}); |
}); |
- audit.defineTask('finish', function (done) { |
- done(); |
- }); |
- |
- audit.runTasks( |
- 'silent-channel', |
- 'stereo-down-mixing', |
- 'undefined-channel-layout', |
- 'merging-to-stereo', |
- 'finish' |
- ); |
- |
- successfullyParsed = true; |
+ audit.run(); |
</script> |
</body> |