| Index: third_party/WebKit/LayoutTests/webaudio/resources/audio-codec-test.js
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/audio-codec-test.js b/third_party/WebKit/LayoutTests/webaudio/resources/audio-codec-test.js
|
| index 9393a315db29e01d4d25cf8283f65eb7ba6c75e6..f7e046fafe52cb0a6b1cb343c6623089d766f675 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/resources/audio-codec-test.js
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/resources/audio-codec-test.js
|
| @@ -4,31 +4,28 @@ var lengthInSeconds = 1;
|
| var context = 0;
|
| var bufferLoader = 0;
|
|
|
| -// Run test by loading the file specified by |url|. An optional sample rate can be given to
|
| -// select a context with a different sample rate. The default value is |defaultSampleRate|.
|
| -function runDecodingTest(url, optionalSampleRate)
|
| -{
|
| - if (!window.testRunner)
|
| - return;
|
| +// Run test by loading the file specified by |url|. An optional sample rate can
|
| +// be given to select a context with a different sample rate. The default value
|
| +// is |defaultSampleRate|.
|
| +function runDecodingTest(url, optionalSampleRate) {
|
| + if (!window.testRunner)
|
| + return;
|
|
|
| - var sampleRate = (typeof optionalSampleRate === "undefined") ? defaultSampleRate : optionalSampleRate;
|
| + let sampleRate = (typeof optionalSampleRate === 'undefined') ?
|
| + defaultSampleRate :
|
| + optionalSampleRate;
|
|
|
| - // Create offline audio context.
|
| - context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, sampleRate);
|
| -
|
| - bufferLoader = new BufferLoader(
|
| - context,
|
| - [ url ],
|
| - finishedLoading
|
| - );
|
| -
|
| - bufferLoader.load();
|
| - testRunner.waitUntilDone();
|
| -}
|
| + // Create offline audio context.
|
| + context =
|
| + new OfflineAudioContext(1, sampleRate * lengthInSeconds, sampleRate);
|
| +
|
| + bufferLoader = new BufferLoader(context, [url], finishedLoading);
|
|
|
| -function finishedLoading(bufferList)
|
| -{
|
| - testRunner.setAudioData(createAudioData(bufferList[0]));
|
| - testRunner.notifyDone();
|
| + bufferLoader.load();
|
| + testRunner.waitUntilDone();
|
| }
|
|
|
| +function finishedLoading(bufferList) {
|
| + testRunner.setAudioData(createAudioData(bufferList[0]));
|
| + testRunner.notifyDone();
|
| +}
|
|
|