| Index: third_party/WebKit/LayoutTests/webaudio/event-constructor.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/event-constructor.html b/third_party/WebKit/LayoutTests/webaudio/event-constructor.html
|
| index 1aafcbae1db7146e2bcadcb0c34784b793f62d51..7ea4c9966eb30a97789aec2b4155013859f954d8 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/event-constructor.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/event-constructor.html
|
| @@ -5,177 +5,147 @@
|
| <script src="../resources/testharness.js"></script>
|
| <script src="../resources/testharnessreport.js"></script>
|
| <script src="resources/audit-util.js"></script>
|
| - <script src="resources/audio-testing.js"></script>
|
| + <script src="resources/audit.js"></script>
|
| </head>
|
|
|
| <body>
|
| <script>
|
| var audit = Audit.createTaskRunner();
|
|
|
| - audit.defineTask("offline-constructor", function (taskDone) {
|
| - var success = true;
|
| -
|
| - success = Should("new OfflineAudioCompletionEvent()", function () {
|
| + audit.define('offline-constructor', (task, should) => {
|
| + should(function() {
|
| new OfflineAudioCompletionEvent();
|
| - }).throw("TypeError") && success;
|
| -
|
| - success = Should('new OfflineAudioCompletionEvent("complete")',
|
| - function () {
|
| - new OfflineAudioCompletionEvent("complete");
|
| - }).throw("TypeError") && success;
|
| -
|
| - success = Should('new OfflineAudioCompletionEvent("complete", {})',
|
| - function () {
|
| - new OfflineAudioCompletionEvent("complete", {});
|
| - }).throw("TypeError") && success;
|
| -
|
| - success = Should(
|
| - 'new OfflineAudioCompletionEvent("complete", {foo: 42})',
|
| - function () {
|
| - new OfflineAudioCompletionEvent("complete", {
|
| - foo: 42
|
| - });
|
| - }).throw("TypeError") && success;
|
| + }, 'new OfflineAudioCompletionEvent()').throw('TypeError');
|
| +
|
| + should(function() {
|
| + new OfflineAudioCompletionEvent('complete');
|
| + }, 'new OfflineAudioCompletionEvent("complete")').throw('TypeError');
|
| +
|
| + should(
|
| + function() {
|
| + new OfflineAudioCompletionEvent('complete', {});
|
| + },
|
| + 'new OfflineAudioCompletionEvent("complete", {})')
|
| + .throw('TypeError');
|
| +
|
| + should(
|
| + function() {
|
| + new OfflineAudioCompletionEvent('complete', {foo: 42});
|
| + },
|
| + 'new OfflineAudioCompletionEvent("complete", {foo: 42})')
|
| + .throw('TypeError');
|
|
|
| var context = new OfflineAudioContext(1, 100, 48000);
|
| - var buffer = new AudioBuffer(context, {
|
| - length: 42
|
| - });
|
| -
|
| - success = Should(
|
| - 'new OfflineAudioCompletionEvent("complete", {renderedBuffer: buffer})',
|
| - function () {
|
| - new OfflineAudioCompletionEvent("complete", {
|
| - renderedBuffer: buffer
|
| - });
|
| - }).notThrow() && success;
|
| -
|
| - Should("OfflineAudioCompletionEvent construction handled", success)
|
| - .summarize("correctly", "incorrectly");
|
| -
|
| - taskDone();
|
| + var buffer = new AudioBuffer(context, {length: 42});
|
| +
|
| + should(
|
| + function() {
|
| + new OfflineAudioCompletionEvent(
|
| + 'complete', {renderedBuffer: buffer});
|
| + },
|
| + 'new OfflineAudioCompletionEvent("complete", {renderedBuffer: buffer})')
|
| + .notThrow();
|
| +
|
| + task.done();
|
| });
|
|
|
| - audit.defineTask("offline-event", function (taskDone) {
|
| + audit.define('offline-event', (task, should) => {
|
| // Only need the context for constructing the AudioBuffers for the
|
| // tests.
|
| var context = new OfflineAudioContext(1, 100, 48000);
|
|
|
| - var success = true;
|
| -
|
| // Just an arbitrary AudioBuffer.
|
| - var buffer = new AudioBuffer(context, {
|
| - length: 10
|
| - });
|
| + var buffer = new AudioBuffer(context, {length: 10});
|
|
|
| var event;
|
| - success = Should("new OfflineAudioCompletionEvent()", function () {
|
| - event = new OfflineAudioCompletionEvent("foo", {
|
| - renderedBuffer: buffer
|
| - });
|
| - }).notThrow() && success;
|
| -
|
| - success = Should("event.renderedBuffer == buffer", event.renderedBuffer ==
|
| - buffer)
|
| - .beEqualTo(true) && success;
|
| + should(function() {
|
| + event =
|
| + new OfflineAudioCompletionEvent('foo', {renderedBuffer: buffer});
|
| + }, 'new OfflineAudioCompletionEvent()').notThrow();
|
|
|
| - Should("OfflineAudioCompletionEvent constructed", success)
|
| - .summarize("correctly",
|
| - "incorrectly");
|
| + should(event.renderedBuffer == buffer, 'event.renderedBuffer == buffer')
|
| + .beEqualTo(true);
|
|
|
| - taskDone();
|
| + task.done();
|
| });
|
|
|
| - audit.defineTask("audio-processing", function (taskDone) {
|
| + audit.define('audio-processing', (task, should) => {
|
| // Only need the context for constructing the AudioBuffers for the
|
| // tests.
|
| var context = new OfflineAudioContext(1, 100, 48000);
|
|
|
| // Fairly arbitrary buffers and time
|
| - var input = new AudioBuffer(context, {
|
| - length: 10
|
| - });
|
| - var output = new AudioBuffer(context, {
|
| - length: 20
|
| - });
|
| + var input = new AudioBuffer(context, {length: 10});
|
| + var output = new AudioBuffer(context, {length: 20});
|
| var time = Math.PI;
|
|
|
| - var success = true;
|
| -
|
| // Verify required arguments.
|
| - success = Should("new AudioProcessingEvent()", function () {
|
| + should(function() {
|
| new AudioProcessingEvent();
|
| - }).throw("TypeError") && success;
|
| -
|
| - success = Should('new AudioProcessingEvent("proc")', function () {
|
| - new AudioProcessingEvent("proc");
|
| - }).throw("TypeError") && success;
|
| -
|
| - success = Should('new AudioProcessingEvent("proc", {foo: 99})',
|
| - function () {
|
| - new AudioProcessingEvent("proc", {
|
| - foo: 99
|
| - });
|
| - }).throw("TypeError") && success;
|
| -
|
| - success = Should(
|
| - 'new AudioProcessingEvent("proc", {inputBuffer: input, outputBuffer: output})',
|
| - function () {
|
| - new AudioProcessingEvent("proc", {
|
| - inputBuffer: input,
|
| - outputBuffer: output
|
| - });
|
| - }).throw("TypeError") && success;
|
| -
|
| - success = Should(
|
| - 'new AudioProcessingEvent("proc", {inputBuffer: input, playbackTime: time})',
|
| - function () {
|
| - new AudioProcessingEvent("proc", {
|
| - inputBuffer: input,
|
| - playbackTime: time
|
| - });
|
| - }).throw("TypeError") && success;
|
| -
|
| - success = Should(
|
| - 'new AudioProcessingEvent("proc", {outputBuffer: output, playbackTime: time})',
|
| - function () {
|
| - new AudioProcessingEvent("proc", {
|
| - outputBuffer: output,
|
| - playbackTime: time
|
| - });
|
| - }).throw("TypeError") && success;
|
| + }, 'new AudioProcessingEvent()').throw('TypeError');
|
| +
|
| + should(function() {
|
| + new AudioProcessingEvent('proc');
|
| + }, 'new AudioProcessingEvent("proc")').throw('TypeError');
|
| +
|
| + should(function() {
|
| + new AudioProcessingEvent('proc', {foo: 99});
|
| + }, 'new AudioProcessingEvent("proc", {foo: 99})').throw('TypeError');
|
| +
|
| + should(
|
| + function() {
|
| + new AudioProcessingEvent(
|
| + 'proc', {inputBuffer: input, outputBuffer: output});
|
| + },
|
| + 'new AudioProcessingEvent("proc", ' +
|
| + '{inputBuffer: input, outputBuffer: output})')
|
| + .throw('TypeError');
|
| +
|
| + should(
|
| + function() {
|
| + new AudioProcessingEvent(
|
| + 'proc', {inputBuffer: input, playbackTime: time});
|
| + },
|
| + 'new AudioProcessingEvent("proc", ' +
|
| + '{inputBuffer: input, playbackTime: time})')
|
| + .throw('TypeError');
|
| +
|
| + should(
|
| + function() {
|
| + new AudioProcessingEvent(
|
| + 'proc', {outputBuffer: output, playbackTime: time});
|
| + },
|
| + 'new AudioProcessingEvent("proc", ' +
|
| + '{outputBuffer: output, playbackTime: time})')
|
| + .throw('TypeError');
|
|
|
|
|
| // Finally test valid call
|
| var event;
|
| - success = Should(
|
| - 'new AudioProcessingEvent("proc", {inputBuffer: input, outputBuffer: output, playbackTime: time})',
|
| - function () {
|
| - event = new AudioProcessingEvent("proc", {
|
| - inputBuffer: input,
|
| - outputBuffer: output,
|
| - playbackTime: time
|
| - });
|
| - }).notThrow() && success;
|
| -
|
| - success = Should("event.playbackTime", event.playbackTime)
|
| - .beEqualTo(time) && success;
|
| -
|
| - success = Should("event.inputBuffer == input", event.inputBuffer ==
|
| - input)
|
| - .beEqualTo(true) && success;
|
| -
|
| - success = Should("event.outputBuffer == output", event.outputBuffer ==
|
| - output)
|
| - .beEqualTo(true) && success;
|
| -
|
| - Should("AudioProcessingEvent construction handled", success)
|
| - .summarize("correctly", "incorrectly");
|
| -
|
| - taskDone();
|
| + should(
|
| + function() {
|
| + event = new AudioProcessingEvent('proc', {
|
| + inputBuffer: input,
|
| + outputBuffer: output,
|
| + playbackTime: time
|
| + });
|
| + },
|
| + 'new AudioProcessingEvent("proc", ' +
|
| + '{inputBuffer: input, outputBuffer: output, playbackTime: time})')
|
| + .notThrow();
|
| +
|
| + should(event.playbackTime, 'event.playbackTime').beEqualTo(time);
|
| +
|
| + should(event.inputBuffer == input, 'event.inputBuffer == input')
|
| + .beEqualTo(true);
|
| +
|
| + should(event.outputBuffer == output, 'event.outputBuffer == output')
|
| + .beEqualTo(true);
|
| +
|
| + task.done();
|
| });
|
|
|
| - audit.runTasks();
|
| + audit.run();
|
| </script>
|
| </body>
|
| </html>
|
|
|