| 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>
|
|
|