Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html b/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html |
| index b90034c4e96766709e4a3dad1c6e668d25801575..585bf36d088c26db6f594e18f9ecc92a7fa31a9a 100644 |
| --- a/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html |
| +++ b/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html |
| @@ -2,45 +2,27 @@ |
| <html> |
| <head> |
| <title>Validate Reduction Value of DynamicsComporessor after Disabling</title> |
| - <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/audio-testing.js"></script> |
| + <script src="../resources/audit.js"></script> |
| </head> |
| <body> |
| <script> |
| - description("Validate Reduction Value of DynamicsComporessor after Disabling"); |
| + let audit = Audit.createTaskRunner(); |
| + let context; |
| + let buffer; |
| + let source; |
| + let compressor; |
| - var context; |
| - var buffer; |
| - var source; |
| - var compressor; |
| - var renderedData; |
| - |
| - var sampleRate = 44100; |
| - var testDurationSamples = 44100; |
| - |
| - function checkResult (event) { |
| - |
| - renderedData = event.renderedBuffer.getChannelData(0); |
| - |
| - // Check that the reduction value is 0.0. |
| - if (compressor.reduction !== 0.0) { |
| - testFailed("Expected reduction of 0.0, but the value is " + compressor.reduction); |
| - } |
| - else { |
| - testPassed("Reduction is 0.0"); |
| - } |
| - |
| - finishJSTest(); |
| - } |
| - |
| - function runTest() { |
| - window.jsTestIsAsync = true; |
| + let sampleRate = 44100; |
| + let testDurationSamples = 44100; |
| + audit.define("test", function (task, should) { |
| + task.describe("Validate Reduction Value of DynamicsCompressor after Disabling"); |
|
hongchan
2017/02/06 17:30:26
The new code needs to be wrapped.
Raymond Toy
2017/02/06 18:12:20
Done.
|
| // Create the offline context for the test. |
| context = new OfflineAudioContext(1, testDurationSamples, sampleRate); |
| - context.oncomplete = checkResult; |
| // Create the constant sample buffer of 0.5 sec. |
| buffer = createConstantBuffer(context, testDurationSamples / 2, 1); |
| @@ -56,11 +38,16 @@ |
| source.start(0.0); |
| // Render it! |
| - context.startRendering(); |
| - } |
| - |
| - runTest(); |
| - succesfullyParsed = true; |
| + context.startRendering() |
| + .then(() => { |
| + // Check that the reduction value is 0.0. |
| + should(compressor.reduction, "compressor.reduction") |
| + .beEqualTo(0); |
| + task.done(); |
| + }); |
| + }); |
| + |
| + audit.run(); |
| </script> |
| </body> |
| </html> |