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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-zero.html

Issue 2892803002: Fix layout tests to prevent errors from layout-test-tidy (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/AudioBufferSource/audiobuffersource-playbackrate-zero.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-zero.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-zero.html
index 9dfc522cd36cb91e7cf9ecd86a5c3ab77cf3f8a6..b4b92dfe712f91cba1986417430860d565cef4b7 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-zero.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-zero.html
@@ -14,20 +14,20 @@
// Sample rate should be power of 128 to observe the change of AudioParam at
// the beginning of rendering quantum. (playbackRate is k-rate) This is the
// minimum sample rate in the valid sample rate range.
- var sampleRate = 4096;
+ let sampleRate = 4096;
// The render duration in seconds, and the length in samples.
- var renderDuration = 1.0;
- var renderLength = renderDuration * sampleRate;
+ let renderDuration = 1.0;
+ let renderLength = renderDuration * sampleRate;
- var context = new OfflineAudioContext(1, renderLength, sampleRate);
- var audit = Audit.createTaskRunner();
+ let context = new OfflineAudioContext(1, renderLength, sampleRate);
+ let audit = Audit.createTaskRunner();
// Task: Render the actual buffer and compare with the reference.
audit.define('synthesize-verify', (task, should) => {
- var ramp = context.createBufferSource();
- var rampBuffer = createLinearRampBuffer(context, renderLength);
+ let ramp = context.createBufferSource();
+ let rampBuffer = createLinearRampBuffer(context, renderLength);
ramp.buffer = rampBuffer;
ramp.connect(context.destination);
@@ -40,12 +40,13 @@
ramp.playbackRate.setValueAtTime(0.0, renderDuration / 2);
context.startRendering().then(function (renderedBuffer) {
- var data = renderedBuffer.getChannelData(0);
- var rampData = rampBuffer.getChannelData(0);
- var half = rampData.length / 2;
- var passed = true;
+ let data = renderedBuffer.getChannelData(0);
+ let rampData = rampBuffer.getChannelData(0);
+ let half = rampData.length / 2;
+ let passed = true;
+ let i;
- for (var i = 1; i < rampData.length; i++) {
+ for (i = 1; i < rampData.length; i++) {
if (i < half) {
// Before the half position, the actual should match with the
// original ramp data.

Powered by Google App Engine
This is Rietveld 408576698