Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurveAtTime.html

Issue 2657033002: Convert AudioParam tests to testharness and new Audit (Closed)
Patch Set: Remove unneeded expected results. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurveAtTime.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurveAtTime.html b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurveAtTime.html
index 2cb0775463b930cc638ba2d436f872dcd32f2ab3..4ffb9c7788d788fed38411ab583a8fb6c833369b 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurveAtTime.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurveAtTime.html
@@ -1,19 +1,17 @@
<!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/audio-testing.js"></script>
+<script src="../resources/audit.js"></script>
<script src="../resources/audioparam-testing.js"></script>
<title>Test AudioParam.setValueCurveAtTime</title>
</head>
<body>
-<div id="description"></div>
-<div id="console"></div>
-
<script>
-description("Test AudioParam setValueCurveAtTime() functionality.");
+let audit = Audit.createTaskRunner();
// Play a long DC signal out through an AudioGainNode and for each time interval call
// setValueCurveAtTime() to set the values for the duration of the interval. Each curve is a sine
@@ -21,21 +19,21 @@ description("Test AudioParam setValueCurveAtTime() functionality.");
// discontinuity between time intervals which is used to test timing.
// Number of tests to run.
-var numberOfTests = 20;
+let numberOfTests = 20;
// Max allowed difference between the rendered data and the expected result. Because of the linear
// interpolation, the rendered curve isn't exactly the same as the reference. This value is
// experimentally determined.
-var maxAllowedError = 3.7194e-6;
+let maxAllowedError = 3.7194e-6;
// The amplitude of the sine wave.
-var sineAmplitude = 1;
+let sineAmplitude = 1;
// Frequency of the sine wave.
-var freqHz = 440;
+let freqHz = 440;
// Curve to use for setValueCurveAtTime().
-var curve;
+let curve;
// Sets the curve data for the entire time interval.
function automation(value, startTime, endTime)
@@ -43,12 +41,12 @@ function automation(value, startTime, endTime)
gainNode.gain.setValueCurveAtTime(curve, startTime, endTime - startTime);
}
-function runTest()
-{
+audit.define("test", function (task, should) {
+ task.describe("AudioParam setValueCurveAtTime() functionality.");
// The curve of values to use.
curve = createSineWaveArray(timeInterval, freqHz, sineAmplitude, sampleRate);
- createAudioGraphAndTest(numberOfTests,
+ createAudioGraphAndTest(task, should, numberOfTests,
sineAmplitude,
function(k) {
// Don't need to set the value.
@@ -59,11 +57,9 @@ function runTest()
createReferenceSineArray,
2 * Math.PI * sineAmplitude * freqHz / sampleRate,
differenceErrorMetric);
-}
-
-runTest();
-successfullyParsed = true;
+});
+audit.run();
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698