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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-time-limits.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/audiosource-time-limits.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-time-limits.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-time-limits.html
index c8b2945bcde3074d1808324d2e410fa5b8dc5dc6..663150845db2e27fee455cd7479751340a19544b 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-time-limits.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiosource-time-limits.html
@@ -1,68 +1,73 @@
-<!doctype html>
+<!DOCTYPE html>
<html>
<head>
+ <title>
+ Test Scheduled Sources with Huge Time Limits
+ </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>
<script src="../resources/audioparam-testing.js"></script>
- <title>Test Scheduled Sources with Huge Time Limits</title>
</head>
-
<body>
- <script>
+ <script id="layout-test-code">
+ let sampleRate = 48000;
+ let renderFrames = 1000;
- var sampleRate = 48000;
- var renderFrames = 1000;
-
- var audit = Audit.createTaskRunner();
+ let audit = Audit.createTaskRunner();
- audit.define("buffersource: huge stop time", (task, should) => {
+ audit.define('buffersource: huge stop time', (task, should) => {
// We only need to generate a small number of frames for this test.
- var context = new OfflineAudioContext(1, renderFrames, sampleRate);
- var src = context.createBufferSource();
+ let context = new OfflineAudioContext(1, renderFrames, sampleRate);
+ let src = context.createBufferSource();
// Constant source of amplitude 1, looping.
src.buffer = createConstantBuffer(context, 1, 1);
src.loop = true;
// Create the graph and go!
- var endTime = 1e300;
+ let endTime = 1e300;
src.connect(context.destination);
src.start();
src.stop(endTime);
- context.startRendering().then(function (resultBuffer) {
- var result = resultBuffer.getChannelData(0);
- should(result,
- "Output from AudioBufferSource.stop(" + endTime + ")")
- .beConstantValueOf(1);
- }).then(() => task.done());
+ context.startRendering()
+ .then(function(resultBuffer) {
+ let result = resultBuffer.getChannelData(0);
+ should(
+ result, 'Output from AudioBufferSource.stop(' + endTime + ')')
+ .beConstantValueOf(1);
+ })
+ .then(() => task.done());
});
-
- audit.define("oscillator: huge stop time", (task, should) => {
+
+ audit.define('oscillator: huge stop time', (task, should) => {
// We only need to generate a small number of frames for this test.
- var context = new OfflineAudioContext(1, renderFrames, sampleRate);
- var src = context.createOscillator();
+ let context = new OfflineAudioContext(1, renderFrames, sampleRate);
+ let src = context.createOscillator();
// Create the graph and go!
- var endTime = 1e300;
+ let endTime = 1e300;
src.connect(context.destination);
src.start();
src.stop(endTime);
- context.startRendering().then(function (resultBuffer) {
- var result = resultBuffer.getChannelData(0);
- // The buffer should not be empty. Just find the max and verify that it's not zero.
- var max = Math.max.apply(null, result);
- should(max,
- "Peak amplitude from oscillator.stop(" + endTime + ")")
- .beGreaterThan(0);
- }).then(() => task.done());
+ context.startRendering()
+ .then(function(resultBuffer) {
+ let result = resultBuffer.getChannelData(0);
+ // The buffer should not be empty. Just find the max and verify
+ // that it's not zero.
+ let max = Math.max.apply(null, result);
+ should(
+ max, 'Peak amplitude from oscillator.stop(' + endTime + ')')
+ .beGreaterThan(0);
+ })
+ .then(() => task.done());
});
-
+
audit.run();
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698