| Index: third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-limits.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-limits.html b/third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-limits.html
|
| index eb9d4ff357e8d13f4b236b639ec5841a4013f8cd..d49fa573997f2acb9ce659913fa797edde1658a4 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-limits.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-limits.html
|
| @@ -1,15 +1,15 @@
|
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
| <html>
|
| <head>
|
| - <script src="../../resources/js-test.js"></script>
|
| + <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>
|
| - <div id="description"></div>
|
| - <div id="console"></div>
|
| -
|
| <script>
|
| - description("Test WaveShaperNode including values outside the range of [-1,1]");
|
| + var audit = Audit.createTaskRunner();
|
|
|
| var context;
|
| var bufferData;
|
| @@ -48,37 +48,22 @@
|
| return ref;
|
| }
|
|
|
| - function checkResult (event) {
|
| - outputData = event.renderedBuffer.getChannelData(0);
|
| + function checkResult (renderedBuffer, should) {
|
| + outputData = renderedBuffer.getChannelData(0);
|
| reference = generateReference();
|
| var success = true;
|
| // Verify that every output value matches our expected reference value.
|
| for (var k = 0; k < outputData.length; ++k) {
|
| var diff = outputData[k] - reference[k];
|
| - if (Math.abs(diff) <= diffThreshold) {
|
| - testPassed(bufferData[k].toFixed(decimals) + " -> " + outputData[k].toFixed(decimals) + ".");
|
| - } else {
|
| - testFailed(bufferData[k].toFixed(decimals) + " -> " + outputData[k].toFixed(decimals) + ", but expected " + reference[k].toFixed(decimals) + ".");
|
| - success = false;
|
| - }
|
| + should(Math.abs(diff),
|
| + "Max error mapping " + bufferData[k].toFixed(decimals) + " to " +
|
| + outputData[k].toFixed(decimals))
|
| + .beLessThanOrEqualTo(diffThreshold);
|
| }
|
| -
|
| - if (success)
|
| - testPassed("All outputs matched expected results.");
|
| - else
|
| - testFailed("Some outputs did not match expected results.");
|
| -
|
| - finishJSTest();
|
| }
|
|
|
| - function runTest () {
|
| - if (window.testRunner) {
|
| - testRunner.dumpAsText();
|
| - testRunner.waitUntilDone();
|
| - }
|
| -
|
| - window.jsTestIsAsync = true;
|
| -
|
| + audit.define("test", function (task, should) {
|
| + task.describe("Test WaveShaperNode including values outside the range of [-1,1]");
|
| context = new OfflineAudioContext(1, testFrames, sampleRate);
|
| // Create input values between -1.1 and 1.1
|
| var buffer = context.createBuffer(1, testFrames, context.sampleRate);
|
| @@ -103,12 +88,12 @@
|
| shaper.connect(context.destination);
|
|
|
| source.start();
|
| - context.oncomplete = checkResult;
|
| - context.startRendering();
|
| - }
|
| + context.startRendering()
|
| + .then(buffer => checkResult(buffer, should))
|
| + .then(() => task.done());
|
| + });
|
|
|
| - runTest();
|
| - successfullyParsed = true;
|
| + audit.run();
|
| </script>
|
| </body>
|
| </html>
|
|
|