| Index: third_party/WebKit/LayoutTests/webaudio/constructor/channelsplitter.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/channelsplitter.html b/third_party/WebKit/LayoutTests/webaudio/constructor/channelsplitter.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..34b3a7592bfae67c2016bfdc4aabe2a9111a7d32
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/constructor/channelsplitter.html
|
| @@ -0,0 +1,134 @@
|
| +<!doctype html>
|
| +<html>
|
| + <head>
|
| + <title>Test Constructor: ChannelSplitter</title>
|
| + <script src="../../resources/testharness.js"></script>
|
| + <script src="../../resources/testharnessreport.js"></script>
|
| + <script src="../resources/audio-testing.js"></script>
|
| + <script src="audionodeoptions.js"></script>
|
| + </head>
|
| +
|
| + <body>
|
| + <script>
|
| + var context;
|
| +
|
| + var audit = Audit.createTaskRunner();
|
| +
|
| + audit.defineTask("initialize", function (taskDone) {
|
| + Should("context = new OfflineAudioContext(...)", function () {
|
| + context = new OfflineAudioContext(1, 1, 48000);
|
| + }).notThrow();
|
| +
|
| + taskDone();
|
| + });
|
| +
|
| + audit.defineTask("invalid constructor", function (taskDone) {
|
| + var node;
|
| + var success = true;
|
| +
|
| + success = Should("new ChannelSplitterNode()", function () {
|
| + node = new ChannelSplitterNode();
|
| + }).throw("TypeError");
|
| + success = Should("new ChannelSplitterNode(1)", function () {
|
| + node = new ChannelSplitterNode(1) && success;
|
| + }).throw("TypeError");
|
| + success = Should("new ChannelSplitterNode(context, 42)", function () {
|
| + node = new ChannelSplitterNode(context, 42) && success;
|
| + }).throw("TypeError");
|
| +
|
| + Should("Invalid constructors", success)
|
| + .summarize(
|
| + "correctly threw errors",
|
| + "did not throw errors in all cases");
|
| +
|
| + taskDone();
|
| + });
|
| +
|
| + audit.defineTask("default constructor", function (taskDone) {
|
| + var node;
|
| + var success = true;
|
| +
|
| + success = Should("node = new ChannelSplitterNode(context)", function () {
|
| + node = new ChannelSplitterNode(context);
|
| + }).notThrow();
|
| + success = Should("node instanceof ChannelSplitterNode", node instanceof ChannelSplitterNode)
|
| + .beEqualTo(true) && success;
|
| +
|
| + success = Should("node.numberOfInputs", node.numberOfInputs)
|
| + .beEqualTo(1) && success;
|
| + success = Should("node.numberOfOutputs", node.numberOfOutputs)
|
| + .beEqualTo(6) && success;
|
| + success = Should("node.channelCount", node.channelCount)
|
| + .beEqualTo(2) && success;
|
| + success = Should("node.channelCountMode", node.channelCountMode)
|
| + .beEqualTo("max") && success;
|
| + success = Should("node.channelInterpretation", node.channelInterpretation)
|
| + .beEqualTo("speakers") && success;
|
| +
|
| + Should("new ChannelSplitterNode(context)", success)
|
| + .summarize(
|
| + "constructed node with correct attributes",
|
| + "did not construct correct node correctly")
|
| +
|
| + taskDone();
|
| + });
|
| +
|
| + audit.defineTask("test AudioNodeOptions", function (taskDone) {
|
| + testAudioNodeOptions(context, "ChannelSplitterNode");
|
| + taskDone();
|
| + });
|
| +
|
| + audit.defineTask("constructor options", function (taskDone) {
|
| + var node;
|
| + var success = true;
|
| + var options = {
|
| + numberOfInputs: 3,
|
| + numberOfOutputs: 9,
|
| + channelInterpretation: "discrete"
|
| + };
|
| +
|
| + success = Should("node = new ChannelSplitterNode(context, <options>)", function () {
|
| + node = new ChannelSplitterNode(context, options);
|
| + }).notThrow();
|
| +
|
| + success = Should("node.numberOfInputs", node.numberOfInputs)
|
| + .beEqualTo(1) && success;
|
| + success = Should("node.numberOfOutputs", node.numberOfOutputs)
|
| + .beEqualTo(options.numberOfOutputs) && success;
|
| + success = Should("node.channelInterpretation", node.channelInterpretation)
|
| + .beEqualTo(options.channelInterpretation) && success;
|
| +
|
| + success = Should("new ChannelSplitterNode(..., { numberOfOutputs: 99 }",
|
| + function () {
|
| + node = new ChannelSplitterNode(context, {
|
| + numberOfOutputs: 99
|
| + });
|
| + })
|
| + .throw("IndexSizeError") && success;
|
| + success = Should("new ChannelSplitterNode(..., { channelCount: 3 }",
|
| + function () {
|
| + node = new ChannelSplitterNode(context, {
|
| + channelCount: 3
|
| + });
|
| + })
|
| + .notThrow() && success;
|
| + success = Should('new ChannelSplitterNode(..., { channelCountMode: "max"}',
|
| + function () {
|
| + node = new ChannelSplitterNode(context, {
|
| + channelCountMode: "max"
|
| + });
|
| + })
|
| + .notThrow() && success;
|
| +
|
| + Should("new ChannelSplitterNode() with options", success)
|
| + .summarize(
|
| + "constructed with correct attributes",
|
| + "was not constructed correctly");
|
| +
|
| + taskDone();
|
| + });
|
| +
|
| + audit.runTasks();
|
| + </script>
|
| + </body>
|
| +</html>
|
|
|