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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-zero.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/Analyser/realtimeanalyser-zero.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-zero.html b/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-zero.html
index 0c780a9292bf14fc5c488c20b7caa8dd87b376de..4abb921493871cdfdc36b7ef500617446b3bbe70 100644
--- a/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-zero.html
+++ b/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-zero.html
@@ -1,35 +1,37 @@
-<!doctype html>
+<!DOCTYPE html>
<html>
<head>
+ <title>
+ Test getFloatFrequencyData With Zero Inputs
+ </title>
<script src="../../resources/testharness.js"></script>
- <script src="../../resources/testharnessreport.js"></script>
+ <script src="../../resources/testharnessreport.js"></script>
<script src="../resources/audit-util.js"></script>
<script src="../resources/audit.js"></script>
- <title>Test getFloatFrequencyData With Zero Inputs</title>
</head>
-
<body>
- <script>
- var sampleRate = 48000;
+ <script id="layout-test-code">
+ let sampleRate = 48000;
- // Render enough data to run the test.
- var renderFrames = 2*1024;
- var renderDuration = renderFrames / sampleRate;
+ // Render enough data to run the test.
+ let renderFrames = 2 * 1024;
+ let renderDuration = renderFrames / sampleRate;
- var audit = Audit.createTaskRunner();
+ let audit = Audit.createTaskRunner();
- // Test that getFloatFrequencyData returns -Infinity when the input is all-zeroes.
- audit.define("zero input", (task, should) => {
- var context = new OfflineAudioContext(1, renderFrames, sampleRate);
+ // Test that getFloatFrequencyData returns -Infinity when the input is
+ // all-zeroes.
+ audit.define('zero input', (task, should) => {
+ let context = new OfflineAudioContext(1, renderFrames, sampleRate);
// Constant source of 0's.
- var source = context.createBufferSource();
+ let source = context.createBufferSource();
source.buffer = createConstantBuffer(context, 1, 0);
source.loop = true;
// Create analyser and use some non-default minDecibels value.
- var analyser = context.createAnalyser();
+ let analyser = context.createAnalyser();
analyser.minDecibels = -123;
source.connect(analyser);
@@ -37,20 +39,22 @@
source.start();
- // Suspend after some number of frames and grab the float frequency data.
- context.suspend(1024 / sampleRate).then(function () {
- var f = new Float32Array(analyser.frequencyBinCount);
- analyser.getFloatFrequencyData(f);
+ // Suspend after some number of frames and grab the float frequency
+ // data.
+ context.suspend(1024 / sampleRate)
+ .then(function() {
+ let f = new Float32Array(analyser.frequencyBinCount);
+ analyser.getFloatFrequencyData(f);
- should(f, "getFloatFrequencyData() with zero-valued input")
- .beConstantValueOf(-Infinity);
- }).then(context.resume.bind(context));
+ should(f, 'getFloatFrequencyData() with zero-valued input')
+ .beConstantValueOf(-Infinity);
+ })
+ .then(context.resume.bind(context));
context.startRendering().then(() => task.done());
});
-
- audit.run();
+ audit.run();
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698