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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-channels.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-channels.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-channels.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-channels.html
index dfae1acc127919dbb546972521f0bdf11eac0dc7..0e4bfb3598b7cee3d8ebc22e706a9bbe71c29acf 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-channels.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-channels.html
@@ -1,65 +1,67 @@
<!DOCTYPE html>
-
<html>
-<head>
-<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>
-let audit = Audit.createTaskRunner();
-let context;
-let source;
-
-audit.define(
- {
- label: 'validate .buffer',
- description: 'Validatation of AudioBuffer in .buffer attribute setter'
- },
- function(task, should) {
- context = new AudioContext();
- source = context.createBufferSource();
-
- // Make sure we can't set to something which isn't an AudioBuffer.
- should(function() {
- source.buffer = 57;
- }, 'source.buffer = 57').throw('TypeError');
+ <head>
+ <title>
+ audiobuffersource-channels.html
+ </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 id="layout-test-code">
+ let audit = Audit.createTaskRunner();
+ let context;
+ let source;
- should(function() {
- source.buffer = null;
- }, 'source.buffer = null').throw('TypeError');
+ audit.define(
+ {
+ label: 'validate .buffer',
+ description:
+ 'Validatation of AudioBuffer in .buffer attribute setter'
+ },
+ function(task, should) {
+ context = new AudioContext();
+ source = context.createBufferSource();
- // Check that mono buffer can be set.
- should(function() {
- let monoBuffer = context.createBuffer(1, 1024, context.sampleRate);
- let testSource = context.createBufferSource();
- testSource.buffer = monoBuffer;
- }, 'Setting source with mono buffer').notThrow();
+ // Make sure we can't set to something which isn't an AudioBuffer.
+ should(function() {
+ source.buffer = 57;
+ }, 'source.buffer = 57').throw('TypeError');
- // Check that stereo buffer can be set.
- should(function() {
- let stereoBuffer = context.createBuffer(2, 1024, context.sampleRate);
- let testSource = context.createBufferSource();
- testSource.buffer = stereoBuffer;
- }, 'Setting source with stereo buffer').notThrow();
+ should(function() {
+ source.buffer = null;
+ }, 'source.buffer = null').throw('TypeError');
- // Check buffers with more than two channels.
- for (let i = 3; i < 10; ++i) {
- should(function() {
- let buffer = context.createBuffer(i, 1024, context.sampleRate);
- let testSource = context.createBufferSource();
- testSource.buffer = buffer;
- }, 'Setting source with ' + i + ' channels buffer').notThrow();
- }
- task.done();
- });
+ // Check that mono buffer can be set.
+ should(function() {
+ let monoBuffer =
+ context.createBuffer(1, 1024, context.sampleRate);
+ let testSource = context.createBufferSource();
+ testSource.buffer = monoBuffer;
+ }, 'Setting source with mono buffer').notThrow();
-audit.run();
+ // Check that stereo buffer can be set.
+ should(function() {
+ let stereoBuffer =
+ context.createBuffer(2, 1024, context.sampleRate);
+ let testSource = context.createBufferSource();
+ testSource.buffer = stereoBuffer;
+ }, 'Setting source with stereo buffer').notThrow();
-</script>
+ // Check buffers with more than two channels.
+ for (let i = 3; i < 10; ++i) {
+ should(function() {
+ let buffer = context.createBuffer(i, 1024, context.sampleRate);
+ let testSource = context.createBufferSource();
+ testSource.buffer = buffer;
+ }, 'Setting source with ' + i + ' channels buffer').notThrow();
+ }
+ task.done();
+ });
-</body>
+ audit.run();
+ </script>
+ </body>
</html>

Powered by Google App Engine
This is Rietveld 408576698