| Index: third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam.html b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam.html
|
| index 2cb620bfa23a9cce48c87130f67ba566281775b7..11181c75e7cf97ac4ca160c35eab000ba9ccc37a 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam.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>
|
| </head>
|
|
|
| <body>
|
| @@ -34,7 +34,7 @@
|
| }
|
|
|
| // Task 1: test disconnect(AudioParam) method.
|
| - audit.defineTask('disconnect(AudioParam)', function (done) {
|
| + audit.define('disconnect(AudioParam)', (task, should) => {
|
|
|
| // Creates a buffer source with value [1] and then connect it to two gain
|
| // nodes in series. The output of the buffer source is lowered by half
|
| @@ -82,15 +82,15 @@
|
| var valueChangeIndex = getValueChangeIndex(channelData, 1.5);
|
|
|
| // Expected values are: 1 * 1.5 * 1.5 -> 1 * 1.5 = [2.25, 1.5]
|
| - Should('Channel #0', channelData).containValues([2.25, 1.5]);
|
| - Should('The index of value change', valueChangeIndex)
|
| + should(channelData, 'Channel #0').containValues([2.25, 1.5]);
|
| + should(valueChangeIndex, 'The index of value change')
|
| .beEqualTo(disconnectIndex);
|
|
|
| - }).then(done);
|
| + }).then(() => task.done());
|
| });
|
|
|
| // Task 2: test disconnect(AudioParam, output) method.
|
| - audit.defineTask('disconnect(AudioParam, output)', function (done) {
|
| + audit.define('disconnect(AudioParam, output)', (task, should) => {
|
|
|
| // Create a 2-channel buffer source with [1, 2] in each channel and
|
| // make a serial connection through gain1 and gain 2. The make the buffer
|
| @@ -149,20 +149,20 @@
|
| var valueChangeIndexCh1 = getValueChangeIndex(channelData1, 3);
|
|
|
| // Expected values are: 1 * 1.5 * 2 -> 1 * 1.5 = [3, 1.5]
|
| - Should('Channel #0', channelData0).containValues([3, 1.5]);
|
| - Should('The index of value change in channel #0', valueChangeIndexCh0)
|
| + should(channelData0, 'Channel #0').containValues([3, 1.5]);
|
| + should(valueChangeIndexCh0, 'The index of value change in channel #0')
|
| .beEqualTo(disconnectIndex);
|
|
|
| // Expected values are: 2 * 1.5 * 2 -> 2 * 1.5 = [6, 3]
|
| - Should('Channel #1', channelData1).containValues([6, 3]);
|
| - Should('The index of value change in channel #1', valueChangeIndexCh1)
|
| + should(channelData1, 'Channel #1').containValues([6, 3]);
|
| + should(valueChangeIndexCh1, 'The index of value change in channel #1')
|
| .beEqualTo(disconnectIndex);
|
|
|
| - }).then(done);
|
| + }).then(() => task.done());
|
| });
|
|
|
| // Task 3: exception checks.
|
| - audit.defineTask('exceptions', function (done) {
|
| + audit.define('exceptions', (task, should) => {
|
| var context = new AudioContext();
|
| var gain1 = context.createGain();
|
| var splitter = context.createChannelSplitter(2);
|
| @@ -179,35 +179,24 @@
|
| gain3.connect(context.destination);
|
|
|
| // gain1 is not connected to gain3.gain. Exception should be thrown.
|
| - Should('gain1.disconnect(gain3.gain)', function () {
|
| + should(function () {
|
| gain1.disconnect(gain3.gain);
|
| - }).throw('InvalidAccessError');
|
| + }, 'gain1.disconnect(gain3.gain)').throw('InvalidAccessError');
|
|
|
| // When the output index is good but the destination is invalid.
|
| - Should('splitter.disconnect(gain1.gain, 1)', function () {
|
| + should(function () {
|
| splitter.disconnect(gain1.gain, 1);
|
| - }).throw('InvalidAccessError');
|
| + }, 'splitter.disconnect(gain1.gain, 1)').throw('InvalidAccessError');
|
|
|
| // When both arguments are wrong, throw IndexSizeError first.
|
| - Should('splitter.disconnect(gain1.gain, 2)', function () {
|
| + should(function () {
|
| splitter.disconnect(gain1.gain, 2);
|
| - }).throw('IndexSizeError');
|
| + }, 'splitter.disconnect(gain1.gain, 2)').throw('IndexSizeError');
|
|
|
| - done();
|
| + task.done();
|
| });
|
|
|
| - audit.defineTask('finish', function (done) {
|
| - done();
|
| - });
|
| -
|
| - audit.runTasks(
|
| - 'disconnect(AudioParam)',
|
| - 'disconnect(AudioParam, output)',
|
| - 'exceptions',
|
| - 'finish'
|
| - );
|
| -
|
| - successfullyParsed = true;
|
| + audit.run();
|
| </script>
|
| </body>
|
|
|
|
|