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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode.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/MediaElementAudioSource/mediaelementaudiosourcenode.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode.html b/third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode.html
index 12bc1a90a885b241d5b5b729fd80989359247032..ac540ad782c6755c62fee670e0b449ebf017300d 100644
--- a/third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode.html
+++ b/third_party/WebKit/LayoutTests/webaudio/MediaElementAudioSource/mediaelementaudiosourcenode.html
@@ -1,76 +1,79 @@
<!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();
-
-audit.define(
- {
- label: 'test',
- description: 'Basic tests for MediaElementAudioSourceNode API'
- },
- (task, should) => {
-
- let context = new AudioContext();
+ <head>
+ <title>
+ mediaelementaudiosourcenode.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 audioElement = new Audio();
- let mediaSource = context.createMediaElementSource(audioElement);
- let audioNode = mediaSource;
+ audit.define(
+ {
+ label: 'test',
+ description: 'Basic tests for MediaElementAudioSourceNode API'
+ },
+ (task, should) => {
- // Check number of inputs and outputs.
- should(audioNode.numberOfInputs, 'audioNode.numberOfInputs').beEqualTo(0);
- should(audioNode.numberOfOutputs, 'audioNode.numberOfOutputs')
- .beEqualTo(1);
+ let context = new AudioContext();
- // Try calling connect() method with illegal values: illegal destination,
- // illegal output index, and illegal input index.
- should(() => audioNode.connect(0, 0, 0), 'audioNode.connect(0, 0, 0)')
- .throw('TypeError');
- should(
- () => audioNode.connect(context.destination, 5, 0),
- 'audioNode.connect(context.destination, 5, 0)')
- .throw('IndexSizeError');
- should(
- () => audioNode.connect(context.destination, 0, 5),
- 'audioNode.connect(context.destination, 0, 5)')
- .throw('IndexSizeError');
+ let audioElement = new Audio();
+ let mediaSource = context.createMediaElementSource(audioElement);
+ let audioNode = mediaSource;
- // Verify same object is returned.
- let element = mediaSource.mediaElement;
- should(element instanceof HTMLMediaElement,
- 'mediaSource.mediaElement instanceof HTMLMediaElement')
- .beTrue();
- should(mediaSource.mediaElement === element,
- 'mediaSource.mediaElement is same object')
- .beTrue();
+ // Check number of inputs and outputs.
+ should(audioNode.numberOfInputs, 'audioNode.numberOfInputs')
+ .beEqualTo(0);
+ should(audioNode.numberOfOutputs, 'audioNode.numberOfOutputs')
+ .beEqualTo(1);
- // Try calling connect() with proper values.
- should(
- () => audioNode.connect(context.destination, 0, 0),
- 'audioNode.connect(context.destination, 0, 0)')
- .notThrow();
+ // Try calling connect() method with illegal values: illegal
+ // destination, illegal output index, and illegal input index.
+ should(
+ () => audioNode.connect(0, 0, 0), 'audioNode.connect(0, 0, 0)')
+ .throw('TypeError');
+ should(
+ () => audioNode.connect(context.destination, 5, 0),
+ 'audioNode.connect(context.destination, 5, 0)')
+ .throw('IndexSizeError');
+ should(
+ () => audioNode.connect(context.destination, 0, 5),
+ 'audioNode.connect(context.destination, 0, 5)')
+ .throw('IndexSizeError');
- // Try creating another MediaElementAudioSourceNode using the same audio
- // element.
- should(
- () => context.createMediaElementSource(audioElement),
- 'context.createMediaElementSource(audioElement)')
- .throw();
+ // Verify same object is returned.
+ let element = mediaSource.mediaElement;
+ should(
+ element instanceof HTMLMediaElement,
+ 'mediaSource.mediaElement instanceof HTMLMediaElement')
+ .beTrue();
+ should(
+ mediaSource.mediaElement === element,
+ 'mediaSource.mediaElement is same object')
+ .beTrue();
- task.done();
- });
+ // Try calling connect() with proper values.
+ should(
+ () => audioNode.connect(context.destination, 0, 0),
+ 'audioNode.connect(context.destination, 0, 0)')
+ .notThrow();
-audit.run();
+ // Try creating another MediaElementAudioSourceNode using the same
+ // audio element.
+ should(
+ () => context.createMediaElementSource(audioElement),
+ 'context.createMediaElementSource(audioElement)')
+ .throw();
-</script>
+ task.done();
+ });
-</body>
+ audit.run();
+ </script>
+ </body>
</html>

Powered by Google App Engine
This is Rietveld 408576698