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 2895963003: Apply layout-test-tidy to LayoutTests/webaudio (Closed)
Patch Set: Created 3 years, 7 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 2abb476cd1b45ef4176af83ecb65511bfa43c5db..281facad8847ff2d5d857216a16727c3b9484bfe 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurveAtTime.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurveAtTime.html
@@ -1,65 +1,71 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
<html>
-<head>
-<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>
-<script src="../resources/audioparam-testing.js"></script>
-<title>Test AudioParam.setValueCurveAtTime</title>
-</head>
+ <head>
+ <title>
+ Test AudioParam.setValueCurveAtTime
+ </title>
+ <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>
+ <script src="../resources/audioparam-testing.js"></script>
+ </head>
+ <body>
+ <script id="layout-test-code">
+ let audit = Audit.createTaskRunner();
-<body>
-<script>
-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 wave, and we assume that the
+ // time interval is not an exact multiple of the period. This causes a
+ // discontinuity between time intervals which is used to test timing.
-// 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 wave, and we assume that the time interval is
-// not an exact multiple of the period. This causes a discontinuity between time
-// intervals which is used to test timing.
+ // Number of tests to run.
+ let numberOfTests = 20;
-// Number of tests to run.
-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.
+ let maxAllowedError = 3.7194e-6;
-// 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.
-let maxAllowedError = 3.7194e-6;
+ // The amplitude of the sine wave.
+ let sineAmplitude = 1;
-// The amplitude of the sine wave.
-let sineAmplitude = 1;
+ // Frequency of the sine wave.
+ let freqHz = 440;
-// Frequency of the sine wave.
-let freqHz = 440;
+ // Curve to use for setValueCurveAtTime().
+ let curve;
-// Curve to use for setValueCurveAtTime().
-let curve;
+ // Sets the curve data for the entire time interval.
+ function automation(value, startTime, endTime) {
+ gainNode.gain.setValueCurveAtTime(
+ curve, startTime, endTime - startTime);
+ }
-// Sets the curve data for the entire time interval.
-function automation(value, startTime, endTime) {
- gainNode.gain.setValueCurveAtTime(curve, startTime, endTime - startTime);
-}
+ audit.define(
+ {
+ label: 'test',
+ description: 'AudioParam setValueCurveAtTime() functionality.'
+ },
+ function(task, should) {
+ // The curve of values to use.
+ curve = createSineWaveArray(
+ timeInterval, freqHz, sineAmplitude, sampleRate);
-audit.define({
- label: 'test',
- description: 'AudioParam setValueCurveAtTime() functionality.'
-}, function(task, should) {
- // The curve of values to use.
- curve = createSineWaveArray(timeInterval, freqHz, sineAmplitude, sampleRate);
+ createAudioGraphAndTest(
+ task, should, numberOfTests, sineAmplitude,
+ function(k) {
+ // Don't need to set the value.
+ },
+ automation, 'setValueCurveAtTime()', maxAllowedError,
+ createReferenceSineArray,
+ 2 * Math.PI * sineAmplitude * freqHz / sampleRate,
+ differenceErrorMetric);
+ });
- createAudioGraphAndTest(
- task, should, numberOfTests, sineAmplitude,
- function(k) {
- // Don't need to set the value.
- },
- automation, 'setValueCurveAtTime()', maxAllowedError,
- createReferenceSineArray,
- 2 * Math.PI * sineAmplitude * freqHz / sampleRate, differenceErrorMetric);
-});
-
-audit.run();
-</script>
-
-</body>
+ audit.run();
+ </script>
+ </body>
</html>

Powered by Google App Engine
This is Rietveld 408576698