| Index: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulated-impulse.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulated-impulse.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulated-impulse.html
|
| index c223fa1c0f56a46aea4dfd8a10b6f7f2fef4bc12..c60ef00fdf421e98914f58b54172005d55238f0d 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulated-impulse.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulated-impulse.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>
|
| @@ -30,27 +30,31 @@
|
|
|
|
|
| // Task: build an impulse and DC-offset buffers for testing.
|
| - audit.defineTask('build-buffers', function (done) {
|
| - // 4-sample impulse sample.
|
| - impulseBuffer = createImpulseBuffer(context, impulseLength);
|
| -
|
| - // Create a DC offset buffer with 2 values [0, 1200] for modulating
|
| - // detune. The first half of buffer is 0 and the rest is 1200.
|
| - dcOffsetBuffer = context.createBuffer(1, renderLength, sampleRate);
|
| - var dcOffsetArray = dcOffsetBuffer.getChannelData(0);
|
| - for (i = 0; i < dcOffsetArray.length; i++) {
|
| -
|
| - // Note that these values will be added to the detune AudioParam
|
| - // value. For example, 1 DC offset value will result detune of 1200.
|
| - dcOffsetArray[i] = i < half ? 0 : 1200;
|
| - }
|
| -
|
| - done();
|
| + audit.define('build-buffers', (task, should) => {
|
| + should(() => {
|
| + // 4-sample impulse sample.
|
| + impulseBuffer = createImpulseBuffer(context, impulseLength);
|
| +
|
| + // Create a DC offset buffer with 2 values [0, 1200] for modulating
|
| + // detune. The first half of buffer is 0 and the rest is 1200.
|
| + dcOffsetBuffer = context.createBuffer(1, renderLength,
|
| + sampleRate);
|
| + var dcOffsetArray = dcOffsetBuffer.getChannelData(0);
|
| + for (i = 0; i < dcOffsetArray.length; i++) {
|
| +
|
| + // Note that these values will be added to the detune AudioParam
|
| + // value. For example, 1 DC offset value will result detune of 1200.
|
| + dcOffsetArray[i] = i < half ? 0 : 1200;
|
| + }
|
| + }, "Creation of impulse buffers")
|
| + .notThrow();
|
| +
|
| + task.done();
|
| });
|
|
|
|
|
| // Task: Render the actual buffer and compare with the reference.
|
| - audit.defineTask('synthesize-verify', function (done) {
|
| + audit.define('synthesize-verify', (task, should) => {
|
| var impulse = context.createBufferSource();
|
| var dcOffset = context.createBufferSource();
|
|
|
| @@ -83,24 +87,14 @@
|
| i++;
|
| }
|
|
|
| - Should('Increasing detune', passed)
|
| - .summarize(
|
| + should(passed, 'Increasing detune')
|
| + .message(
|
| 'to 1200 decreased the interval between impulses to half',
|
| 'produced the incorrect result' + 'at the index ' + i);
|
| - }).then(done);
|
| + }).then(() => task.done());
|
| });
|
|
|
| - audit.defineTask('finish', function (done) {
|
| - done();
|
| - });
|
| -
|
| - audit.runTasks(
|
| - 'build-buffers',
|
| - 'synthesize-verify',
|
| - 'finish'
|
| - );
|
| -
|
| - successfullyParsed = true;
|
| + audit.run();
|
| </script>
|
| </body>
|
|
|
|
|