| Index: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html
|
| index 4fd472751a04b93d3cf86c125fd42553171ffd93..a060df0482b35bc19765f38c5abd518af31cd966 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html
|
| @@ -1,71 +1,75 @@
|
| <!DOCTYPE html>
|
| <html>
|
| + <head>
|
| + <title>
|
| + audiobuffersource-playbackrate-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;
|
|
|
| -<body>
|
| - <script>
|
| + let audit = Audit.createTaskRunner();
|
|
|
| - var sampleRate = 44100;
|
| - var duration = 0.25;
|
| + // 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-playbackrate-modulation-expected.wav'],
|
| + function(bufferList) {
|
| + referenceBuffer = bufferList[0];
|
| + should(true, 'Loaded reference file').beTrue();
|
| + task.done();
|
| + });
|
|
|
| - var context = new OfflineAudioContext(1, sampleRate * duration, sampleRate);
|
| - var referenceBuffer;
|
| + loader.load();
|
| + });
|
|
|
| - var audit = Audit.createTaskRunner();
|
|
|
| - // 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-playbackrate-modulation-expected.wav'
|
| - ], function (bufferList) {
|
| - referenceBuffer = bufferList[0];
|
| - should(true, "Loaded reference file").beTrue();
|
| - task.done();
|
| - });
|
| + // Task: Render the actual buffer and compare with the reference.
|
| + audit.define('generate-verify', (task, should) => {
|
|
|
| - loader.load();
|
| - });
|
| + // With this setting, the playback rate will be changing continuously
|
| + // and repeatedly within the range of [0, 200] around 100Hz, based on
|
| + // the input from the oscillator.
|
| + createSawtoothWithModulation(context, 'playbackRate', 100, 100);
|
|
|
| + context.startRendering()
|
| + .then(function(renderedBuffer) {
|
| + let actual = renderedBuffer.getChannelData(0);
|
| + let expected = referenceBuffer.getChannelData(0);
|
|
|
| - // Task: Render the actual buffer and compare with the reference.
|
| - audit.define('generate-verify', (task, should) => {
|
| -
|
| - // With this setting, the playback rate will be changing continuously and
|
| - // repeatedly within the range of [0, 200] around 100Hz, based on the
|
| - // input from the oscillator.
|
| - createSawtoothWithModulation(context, 'playbackRate', 100, 100);
|
| + // Compare two buffers with arbitrary (yet reasonable)
|
| + // constraints. There parameters are determined by try bot
|
| + // experiments.
|
| + compareBuffersWithConstraints(should, actual, expected, {
|
| + prefix: 'Verify',
|
| + thresholdSNR: 92.72,
|
| + thresholdDiffULP: 0.985,
|
| + thresholdDiffCount: 0,
|
| + bitDepth: 16
|
| + });
|
|
|
| - context.startRendering().then(function (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: "Verify",
|
| - thresholdSNR: 92.72,
|
| - thresholdDiffULP: 0.985,
|
| - thresholdDiffCount: 0,
|
| - bitDepth: 16
|
| - });
|
| -
|
| - var filename = 'audiobuffersource-playbackrate-modulation-actual.wav';
|
| - if (downloadAudioBuffer(renderedBuffer, filename))
|
| - should(true, "Saved reference file").message(filename, "");
|
| - }).then(() => task.done());
|
| - });
|
| -
|
| - audit.run();
|
| - </script>
|
| -</body>
|
| + let filename =
|
| + 'audiobuffersource-playbackrate-modulation-actual.wav';
|
| + if (downloadAudioBuffer(renderedBuffer, filename))
|
| + should(true, 'Saved reference file').message(filename, '');
|
| + })
|
| + .then(() => task.done());
|
| + });
|
|
|
| + audit.run();
|
| + </script>
|
| + </body>
|
| </html>
|
|
|