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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/resources/mix-testing.js

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/resources/mix-testing.js
diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/mix-testing.js b/third_party/WebKit/LayoutTests/webaudio/resources/mix-testing.js
index ede59e7d99cd1c74477926c87198b9589bfcab89..4c8ba389260cc4e5d56535a2fcf11a9fe0c8a1ff 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/mix-testing.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/mix-testing.js
@@ -1,23 +1,23 @@
var toneLengthSeconds = 1;
// Create a buffer with multiple channels.
-// The signal frequency in each channel is the multiple of that in the first channel.
+// The signal frequency in each channel is the multiple of that in the first
+// channel.
function createToneBuffer(context, frequency, duration, numberOfChannels) {
- var sampleRate = context.sampleRate;
- var sampleFrameLength = duration * sampleRate;
-
- var audioBuffer = context.createBuffer(numberOfChannels, sampleFrameLength, sampleRate);
+ let sampleRate = context.sampleRate;
+ let sampleFrameLength = duration * sampleRate;
- var n = audioBuffer.length;
+ let audioBuffer =
+ context.createBuffer(numberOfChannels, sampleFrameLength, sampleRate);
- for (var k = 0; k < numberOfChannels; ++k)
- {
- var data = audioBuffer.getChannelData(k);
+ let n = audioBuffer.length;
- for (var i = 0; i < n; ++i)
- data[i] = Math.sin(frequency * (k + 1) * 2.0*Math.PI * i / sampleRate);
- }
+ for (let k = 0; k < numberOfChannels; ++k) {
+ let data = audioBuffer.getChannelData(k);
- return audioBuffer;
-}
+ for (let i = 0; i < n; ++i)
+ data[i] = Math.sin(frequency * (k + 1) * 2.0 * Math.PI * i / sampleRate);
+ }
+ return audioBuffer;
+}

Powered by Google App Engine
This is Rietveld 408576698