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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-grain.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/AudioBufferSource/audiobuffersource-grain.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-grain.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-grain.html
index 0ac2da6be8fb230de80f89608b3f2de5ef81063a..a09be88b9d48aa56397a2f510faeb1c0adf0f81f 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-grain.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-grain.html
@@ -1,15 +1,16 @@
-<!doctype html>
+<!DOCTYPE html>
<html>
<head>
- <title>Test Start Grain with Delayed Buffer Setting </title>
+ <title>
+ Test Start Grain with Delayed Buffer Setting
+ </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>
</head>
-
<body>
- <script>
+ <script id="layout-test-code">
let audit = Audit.createTaskRunner();
let context;
let source;
@@ -22,35 +23,37 @@
let testDurationSamples = testDurationSec * sampleRate;
let startTime = 0.9 * testDurationSec;
- audit.define("Test setting the source buffer after starting the grain",
- function (task, should) {
- context = new OfflineAudioContext(1, testDurationSamples,
- sampleRate);
+ audit.define(
+ 'Test setting the source buffer after starting the grain',
+ function(task, should) {
+ context =
+ new OfflineAudioContext(1, testDurationSamples, sampleRate);
- buffer = createConstantBuffer(context, testDurationSamples, 1);
- source = context.createBufferSource();
- source.connect(context.destination);
+ buffer = createConstantBuffer(context, testDurationSamples, 1);
+ source = context.createBufferSource();
+ source.connect(context.destination);
- // Start the source BEFORE we set the buffer. The grain offset and duration aren't
- // important, as long as we specify some offset.
- source.start(startTime, .1);
- source.buffer = buffer;
+ // Start the source BEFORE we set the buffer. The grain offset and
+ // duration aren't important, as long as we specify some offset.
+ source.start(startTime, .1);
+ source.buffer = buffer;
- // Render it!
- context.startRendering()
- .then(function (buffer) {
- checkResult(buffer, should);
- })
- .then(task.done.bind(task));;
- });
+ // Render it!
+ context.startRendering()
+ .then(function(buffer) {
+ checkResult(buffer, should);
+ })
+ .then(task.done.bind(task));
+ ;
+ });
function checkResult(buffer, should) {
let success = false;
renderedData = buffer.getChannelData(0);
- // Check that the rendered data is not all zeroes. Any non-zero data means the test
- // passed.
+ // Check that the rendered data is not all zeroes. Any non-zero data
+ // means the test passed.
let startFrame = Math.round(startTime * sampleRate);
for (k = 0; k < renderedData.length; ++k) {
if (renderedData[k]) {
@@ -59,7 +62,7 @@
}
}
- should(success, "Buffer was played").beTrue();
+ should(success, 'Buffer was played').beTrue();
}
audit.run();

Powered by Google App Engine
This is Rietveld 408576698