| Index: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
|
| index f19a496aaef09d6dcc829a937ef07865decb732c..69af6762552d0a7df42f847a0f9a5f17298644a8 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
|
| @@ -1,70 +1,75 @@
|
| <!DOCTYPE html>
|
| <html>
|
| + <head>
|
| + <title>
|
| + audiobuffersource-detune-modulation.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/audiobuffersource-testing.js"></script>
|
| + <script src="../resources/buffer-loader.js"></script>
|
| + </head>
|
| + <body>
|
| + <script id="layout-test-code">
|
| + let sampleRate = 44100;
|
| + let duration = 0.25;
|
|
|
| -<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/audiobuffersource-testing.js"></script>
|
| - <script src="../resources/buffer-loader.js"></script>
|
| -</head>
|
| + let context =
|
| + new OfflineAudioContext(1, sampleRate * duration, sampleRate);
|
| + let referenceBuffer;
|
| + let audioBufferResult;
|
|
|
| -<body>
|
| - <script>
|
| - var sampleRate = 44100;
|
| - var duration = 0.25;
|
| + let audit = Audit.createTaskRunner();
|
|
|
| - var context = new OfflineAudioContext(1, sampleRate * duration, sampleRate);
|
| - var referenceBuffer;
|
| - var audioBufferResult;
|
| + // Task: Load the reference file asynchronously. In order to create a new
|
| + // reference file, use the task 'generate-reference' below.
|
| + audit.define('load-reference', (task, should) => {
|
| + let loader = new BufferLoader(
|
| + context, ['audiobuffersource-detune-modulation-expected.wav'],
|
| + function(bufferList) {
|
| + referenceBuffer = bufferList[0];
|
| + task.done();
|
| + });
|
|
|
| - var audit = Audit.createTaskRunner();
|
| + loader.load();
|
| + });
|
|
|
| - // Task: Load the reference file asynchronously. In order to create a new
|
| - // reference file, use the task 'generate-reference' below.
|
| - audit.define('load-reference', (task, should) => {
|
| - var loader = new BufferLoader(context, [
|
| - 'audiobuffersource-detune-modulation-expected.wav'
|
| - ], function (bufferList) {
|
| - referenceBuffer = bufferList[0];
|
| - task.done();
|
| - });
|
|
|
| - loader.load();
|
| - });
|
| + // Task: Render the actual buffer and compare with the reference.
|
| + audit.define('generate-verify', (task, should) => {
|
|
|
| + // With this setting, the detune will be changing continuously and
|
| + // repeatedly within the range of [-1200, 1200] around 440Hz, based on
|
| + // the input from the oscillator.
|
| + createSawtoothWithModulation(context, 'detune', 440, 1200);
|
|
|
| - // Task: Render the actual buffer and compare with the reference.
|
| - audit.define('generate-verify', (task, should) => {
|
| + context.startRendering()
|
| + .then(function(renderedBuffer) {
|
| + audioBufferResult = renderedBuffer;
|
| + let actual = renderedBuffer.getChannelData(0);
|
| + let expected = referenceBuffer.getChannelData(0);
|
|
|
| - // With this setting, the detune will be changing continuously and
|
| - // repeatedly within the range of [-1200, 1200] around 440Hz, based on the
|
| - // input from the oscillator.
|
| - createSawtoothWithModulation(context, 'detune', 440, 1200);
|
| + // Compare two buffers with arbitrary (yet reasonable)
|
| + // constraints. There parameters are determined by try bot
|
| + // experiments.
|
| + compareBuffersWithConstraints(should, actual, expected, {
|
| + prefix: '',
|
| + thresholdSNR: 93.31,
|
| + thresholdDiffULP: 1.01,
|
| + thresholdDiffCount: 0,
|
| + bitDepth: 16
|
| + });
|
|
|
| - context.startRendering().then(function (renderedBuffer) {
|
| - audioBufferResult = renderedBuffer;
|
| - var actual = renderedBuffer.getChannelData(0);
|
| - var expected = referenceBuffer.getChannelData(0);
|
| -
|
| - // Compare two buffers with arbitrary (yet reasonable) constraints.
|
| - // There parameters are determined by try bot experiments.
|
| - compareBuffersWithConstraints(should, actual, expected, {
|
| - prefix: "",
|
| - thresholdSNR: 93.31,
|
| - thresholdDiffULP: 1.01,
|
| - thresholdDiffCount: 0,
|
| - bitDepth: 16});
|
| -
|
| - var filename = 'audiobuffersource-detune-modulation-actual.wav';
|
| - if (downloadAudioBuffer(renderedBuffer, filename))
|
| - should(true, "Saved reference file").message(filename, "");
|
| - }).then(() => task.done());
|
| - });
|
| -
|
| - audit.run();
|
| - </script>
|
| -</body>
|
| + let filename = 'audiobuffersource-detune-modulation-actual.wav';
|
| + if (downloadAudioBuffer(renderedBuffer, filename))
|
| + should(true, 'Saved reference file').message(filename, '');
|
| + })
|
| + .then(() => task.done());
|
| + });
|
|
|
| + audit.run();
|
| + </script>
|
| + </body>
|
| </html>
|
|
|