| Index: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setTargetAtTime-sampling.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setTargetAtTime-sampling.html b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setTargetAtTime-sampling.html
|
| index e47052efc96fbb254a7ae2dac6bea0ab14a4276f..50e000a0a56d85d1713717e4c2758720cfbe9eb4 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setTargetAtTime-sampling.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setTargetAtTime-sampling.html
|
| @@ -4,7 +4,7 @@
|
| <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>
|
| <script src="../resources/audioparam-testing.js"></script>
|
| <title>Test Sampling for SetTargetAtTime</title>
|
| </head>
|
| @@ -26,7 +26,7 @@
|
|
|
| // Test sampling of setTargetAtTime that starts at |startFrame|. A gain node is used for
|
| // testing. |initializeGainFunction| initializes the gain value.
|
| - function doTest(message, startFrame, threshold, initializeGainFunction) {
|
| + function doTest(should, message, startFrame, threshold, initializeGainFunction) {
|
| var context = new OfflineAudioContext(1, 256, sampleRate);
|
| var source = context.createBufferSource();
|
| var b = context.createBuffer(1, 1, sampleRate);
|
| @@ -52,7 +52,10 @@
|
| // rendered result is within |threshold| of the expected value.
|
| var frame = Math.ceil(startFrame);
|
| var v = 10000 * Math.exp(-(frame / sampleRate - startFrame / sampleRate) / timeConstant);
|
| - Should(message + ": Target value at frame " + frame, resultData[frame]).beCloseTo(v, threshold);
|
| + should(resultData[frame], message + ": Target value at frame " +
|
| + frame).beCloseTo(v, {
|
| + threshold: threshold
|
| + });
|
| });
|
| }
|
|
|
| @@ -64,37 +67,42 @@
|
| g.gain.setValueAtTime(initialGain, 0);
|
| }
|
|
|
| - audit.defineTask("setValue;128.1", function (done) {
|
| - doTest("Initialize by setValueAtTime", 128.1, 3.6029e-8, initializeGainBySetValue).then(done);
|
| + audit.define("setValue;128.1", (task, should) => {
|
| + doTest(should, "Initialize by setValueAtTime", 128.1, 3.6029e-8,
|
| + initializeGainBySetValue)
|
| + .then(() => task.done());
|
| });
|
|
|
| - audit.defineTask("setValue;0.1", function (done) {
|
| - doTest("Initialize by setValueAtTime", 0.1, 3.6029e-8, initializeGainBySetValue).then(done);
|
| + audit.define("setValue;0.1", (task, should) => {
|
| + doTest(should, "Initialize by setValueAtTime", 0.1, 3.6029e-8,
|
| + initializeGainBySetValue)
|
| + .then(() => task.done());
|
| });
|
|
|
| - audit.defineTask("setValue;0.0", function (done) {
|
| - doTest("Initialize by setValueAtTime", 0, 3.6029e-8, initializeGainBySetValue).then(done);
|
| + audit.define("setValue;0.0", (task, should) => {
|
| + doTest(should, "Initialize by setValueAtTime", 0, 3.6029e-8,
|
| + initializeGainBySetValue)
|
| + .then(() => task.done());
|
| });
|
|
|
| - audit.defineTask("setter;128.1", function (done) {
|
| - doTest("Initialize by setter", 128.1, 3.6029e-8, initializeGainBySetter).then(done);
|
| + audit.define("setter;128.1", (task, should) => {
|
| + doTest(should, "Initialize by setter", 128.1, 3.6029e-8,
|
| + initializeGainBySetter)
|
| + .then(() => task.done());
|
| });
|
|
|
| - audit.defineTask("setter;0.1", function (done) {
|
| - doTest("Initialize by setter", 0.1, 3.6029e-8, initializeGainBySetter).then(done);
|
| + audit.define("setter;0.1", (task, should) => {
|
| + doTest(should, "Initialize by setter", 0.1, 3.6029e-8,
|
| + initializeGainBySetter)
|
| + .then(() => task.done());
|
| });
|
|
|
| - audit.defineTask("setter;0.0", function (done) {
|
| - doTest("Initialize by setter", 0, 0, initializeGainBySetter).then(done);
|
| + audit.define("setter;0.0", (task, should) => {
|
| + doTest(should, "Initialize by setter", 0, 0, initializeGainBySetter)
|
| + .then(() => task.done());
|
| });
|
|
|
| -
|
| - audit.defineTask("finish", function (done) {
|
| - done();
|
| - });
|
| -
|
| - audit.runTasks();
|
| - successfullyParsed = true;
|
| + audit.run();
|
| </script>
|
| </body>
|
| </html>
|
|
|