| Index: third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-copy-curve.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-copy-curve.html b/third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-copy-curve.html
|
| index b972c6921b299e6e8141d2bafe494f5ca6063c9d..a635473f1ce185b0d36cd3db779bdada11a80bd7 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-copy-curve.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-copy-curve.html
|
| @@ -1,49 +1,50 @@
|
| -<!doctype html>
|
| +<!DOCTYPE html>
|
| <html>
|
| <head>
|
| - <title>Test WaveShaper Copies Curve Data</title>
|
| + <title>
|
| + Test WaveShaper Copies Curve Data
|
| + </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>
|
| </head>
|
| -
|
| <body>
|
| - <script>
|
| + <script id="layout-test-code">
|
| // Sample rate and number of frames are fairly arbitrary. We need to
|
| // render, however, at least 384 frames. 1024 is a nice small value.
|
| - var sampleRate = 16000;
|
| - var renderFrames = 1024;
|
| + let sampleRate = 16000;
|
| + let renderFrames = 1024;
|
|
|
| - var audit = Audit.createTaskRunner();
|
| + let audit = Audit.createTaskRunner();
|
|
|
| - audit.define("test copying", (task, should) => {
|
| + audit.define('test copying', (task, should) => {
|
| // Two-channel context; channel 0 contains the test data and channel 1
|
| // contains the expected result. Channel 1 has the normal WaveShaper
|
| // output and channel 0 has the WaveShaper output with a modified curve.
|
| - var context = new OfflineAudioContext(2, renderFrames, sampleRate);
|
| + let context = new OfflineAudioContext(2, renderFrames, sampleRate);
|
|
|
| // Just use a default oscillator as the source. Doesn't really matter
|
| // what we use.
|
| - var src = context.createOscillator();
|
| - src.type = "sawtooth";
|
| + let src = context.createOscillator();
|
| + src.type = 'sawtooth';
|
|
|
| // Create the wave shapers: ws0 is the test shaper, and ws1 is the
|
| // reference wave shaper.
|
| - var ws0 = context.createWaveShaper();
|
| - var ws1 = context.createWaveShaper();
|
| + let ws0 = context.createWaveShaper();
|
| + let ws1 = context.createWaveShaper();
|
|
|
| // Wave shaper curves. Doesn't really matter what we use as long as it
|
| // modifies the input in some way. Thus, keep it simple and just invert
|
| // the input.
|
| - var desiredCurve = [1, 0, -1];
|
| - var curve0 = Float32Array.from(desiredCurve);
|
| - var curve1 = Float32Array.from(desiredCurve);
|
| + let desiredCurve = [1, 0, -1];
|
| + let curve0 = Float32Array.from(desiredCurve);
|
| + let curve1 = Float32Array.from(desiredCurve);
|
|
|
| ws0.curve = curve0;
|
| ws1.curve = curve1;
|
|
|
| - var merger = context.createChannelMerger(2);
|
| + let merger = context.createChannelMerger(2);
|
|
|
| // Connect the graph
|
| src.connect(ws0);
|
| @@ -58,25 +59,28 @@
|
| // Doesn't really matter what we modify the curve to as long as it's
|
| // different.
|
| context.suspend(256 / context.sampleRate)
|
| - .then(function () {
|
| - curve0[0] = -0.5;
|
| - curve0[1] = 0.125;
|
| - curve0[2] = 0.75;
|
| - })
|
| - .then(context.resume.bind(context));
|
| + .then(function() {
|
| + curve0[0] = -0.5;
|
| + curve0[1] = 0.125;
|
| + curve0[2] = 0.75;
|
| + })
|
| + .then(context.resume.bind(context));
|
|
|
| src.start();
|
|
|
| - context.startRendering().then(function (renderedBuffer) {
|
| - var actual = renderedBuffer.getChannelData(0);
|
| - var expected = renderedBuffer.getChannelData(1);
|
| + context.startRendering()
|
| + .then(function(renderedBuffer) {
|
| + let actual = renderedBuffer.getChannelData(0);
|
| + let expected = renderedBuffer.getChannelData(1);
|
|
|
| - // Modifying the wave shaper curve should not modify the output so the
|
| - // outputs from the two wave shaper nodes should be exactly identical.
|
| - should(actual, "WaveShaper with modified curve")
|
| - .beEqualToArray(expected);
|
| + // Modifying the wave shaper curve should not modify the output so
|
| + // the outputs from the two wave shaper nodes should be exactly
|
| + // identical.
|
| + should(actual, 'WaveShaper with modified curve')
|
| + .beEqualToArray(expected);
|
|
|
| - }).then(() => task.done());
|
| + })
|
| + .then(() => task.done());
|
| });
|
|
|
| audit.run();
|
|
|