Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiodestination.html |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiodestination.html b/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiodestination.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..adec749ab5d0ce1872abdaa43607faafeaf1572e |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiodestination.html |
| @@ -0,0 +1,72 @@ |
| +<!doctype html> |
| +<html> |
| + <head> |
| + <title>Test Constructor: MediaStreamAudioDestinationNode</title> |
| + <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> |
|
hongchan
2016/12/19 18:29:55
Why do we need this?
Raymond Toy
2016/12/19 18:33:38
You mean instead of audit.js?
audionodeoptions.js
hongchan
2016/12/19 23:40:37
Acknowledged.
|
| + <script src="audionodeoptions.js"></script> |
| + </head> |
| + |
| + <body> |
| + <script> |
| + var context = new AudioContext(); |
| + |
| + var audit = Audit.createTaskRunner(); |
| + |
| + audit.defineTask("invalid constructor", function (taskDone) { |
| + var node; |
| + var success = true; |
| + |
| + success = Should("new MediaStreamAudioDestinationNode()", |
| + function () { |
| + node = new MediaStreamAudioDestinationNode(); |
| + }) |
| + .throw("TypeError"); |
| + success = Should("new MediaStreamAudioDestinationNode(1)", |
| + function () { |
| + node = new MediaStreamAudioDestinationNode(1) |
| + }) |
| + .throw("TypeError") && success;; |
| + success = Should("new MediaStreamAudioDestinationNode(context, 42)", |
| + function () { |
| + node = new MediaStreamAudioDestinationNode(context, 42) |
| + }) |
| + .throw("TypeError") && success;; |
| + |
| + taskDone(); |
| + }); |
| + |
| + audit.defineTask("default constructor", function (taskDone) { |
| + var node; |
| + var success; |
| + |
| + success = Should("new MediaStreamAudioDestinationNode(context)", |
| + function () { |
| + node = new MediaStreamAudioDestinationNode(context); |
| + }).notThrow() && success; |
| + |
| + success = Should("node instanceof MediaStreamAudioDestinationNode", |
| + node instanceof MediaStreamAudioDestinationNode) |
| + .beEqualTo(true) && success; |
| + success = Should("node.channelCount", node.channelCount) |
| + .beEqualTo(2) && success; |
| + |
| + taskDone(); |
| + }); |
| + |
| + audit.defineTask("test AudioNodeOptions", function (taskDone) { |
| + testAudioNodeOptions(context, "MediaStreamAudioDestinationNode", { |
| + expectedChannelCount: { |
| + // An arbitrary but valid, non-default count for this node. |
| + value: 7 |
| + } |
| + }); |
| + taskDone(); |
| + }); |
| + |
| + audit.runTasks(); |
| + </script> |
| + </body> |
| +</html> |