| Index: third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html b/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
|
| index 81247f7f7c062475fe3ba51f3d14b502a22c64a6..97fa3aa37ea2265cb5abd808c673349778677667 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
|
| @@ -5,63 +5,45 @@
|
| <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>
|
| + <script src="new-audionodeoptions.js"></script>
|
| </head>
|
|
|
| <body>
|
| <script>
|
| - var context = new AudioContext();
|
| + let context = new AudioContext();
|
|
|
| - var audit = Audit.createTaskRunner();
|
| + let audit = Audit.createTaskRunner();
|
|
|
| - audit.defineTask("invalid constructor", function (taskDone) {
|
| - var node;
|
| - var success = true;
|
| -
|
| - success = Should("new MediaStreamAudioSourceNode()", function () {
|
| - node = new MediaStreamAudioSourceNode();
|
| - }).throw("TypeError");
|
| - success = Should("new MediaStreamAudioSourceNode(1)", function () {
|
| - node = new MediaStreamAudioSourceNode(1) && success;
|
| - }).throw("TypeError");
|
| - success = Should("new MediaStreamAudioSourceNode(context, 42)",
|
| - function () {
|
| - node = new MediaStreamAudioSourceNode(context, 42) && success;
|
| - }).throw("TypeError");
|
| -
|
| - Should("Invalid constructors", success)
|
| - .summarize(
|
| - "correctly threw errors",
|
| - "did not throw errors in all cases");
|
| + audit.define('initialize', (task, should) => {
|
| + context = initializeContext(should);
|
| + task.done();
|
| + });
|
|
|
| - taskDone();
|
| + audit.define('invalid constructor', (task, should) => {
|
| + testInvalidConstructor(should, 'MediaStreamAudioSourceNode', context);
|
| + task.done();
|
| });
|
|
|
| - audit.defineTask("constructor options", function (taskDone) {
|
| - var node;
|
| - var success = true;
|
| + audit.define('constructor options', (task, should) => {
|
| + let node;
|
|
|
| - var options = {
|
| - mediaStream: new MediaStream()
|
| - };
|
| + let options = {mediaStream: new MediaStream()};
|
|
|
| // We throw because the mediaStream has no tracks. But otherwise the
|
| // constructor worked.
|
| - success = Should("node = new MediaStreamAudioSourceNode(, " + JSON.stringify(
|
| - options) + ")",
|
| - function () {
|
| - node = new MediaStreamAudioSourceNode(context, options);
|
| - }).throw("InvalidStateError") && success;
|
| -
|
| - Should("new MediaStreamAudioSourceNode(c, options)", success)
|
| - .summarize(
|
| - "constructed with correct attributes",
|
| - "was not constructed correctly");
|
| -
|
| - taskDone();
|
| + should(
|
| + () => {
|
| + node = new MediaStreamAudioSourceNode(context, options);
|
| + },
|
| + 'node = new MediaStreamAudioSourceNode(context, ' +
|
| + JSON.stringify(options) + ')')
|
| + .throw('InvalidStateError');
|
| +
|
| + task.done();
|
| });
|
|
|
| - audit.runTasks();
|
| + audit.run();
|
| </script>
|
| </body>
|
| </html>
|
|
|