Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/constructor/channelsplitter.html

Issue 2394953002: ChannelSplitterNode channelCount and mode are constant (Closed)
Patch Set: Rebase and fix incorrect comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Test Constructor: ChannelSplitter</title> 4 <title>Test Constructor: ChannelSplitter</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../resources/audio-testing.js"></script> 7 <script src="../resources/audio-testing.js"></script>
8 <script src="audionodeoptions.js"></script> 8 <script src="audionodeoptions.js"></script>
9 </head> 9 </head>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 node = new ChannelSplitterNode(context); 52 node = new ChannelSplitterNode(context);
53 }).notThrow(); 53 }).notThrow();
54 success = Should("node instanceof ChannelSplitterNode", node instanceof ChannelSplitterNode) 54 success = Should("node instanceof ChannelSplitterNode", node instanceof ChannelSplitterNode)
55 .beEqualTo(true) && success; 55 .beEqualTo(true) && success;
56 56
57 success = Should("node.numberOfInputs", node.numberOfInputs) 57 success = Should("node.numberOfInputs", node.numberOfInputs)
58 .beEqualTo(1) && success; 58 .beEqualTo(1) && success;
59 success = Should("node.numberOfOutputs", node.numberOfOutputs) 59 success = Should("node.numberOfOutputs", node.numberOfOutputs)
60 .beEqualTo(6) && success; 60 .beEqualTo(6) && success;
61 success = Should("node.channelCount", node.channelCount) 61 success = Should("node.channelCount", node.channelCount)
62 .beEqualTo(2) && success; 62 .beEqualTo(node.numberOfOutputs) && success;
63 success = Should("node.channelCountMode", node.channelCountMode) 63 success = Should("node.channelCountMode", node.channelCountMode)
64 .beEqualTo("max") && success; 64 .beEqualTo("explicit") && success;
65 success = Should("node.channelInterpretation", node.channelInterpretatio n) 65 success = Should("node.channelInterpretation", node.channelInterpretatio n)
66 .beEqualTo("speakers") && success; 66 .beEqualTo("speakers") && success;
67 67
68 Should("new ChannelSplitterNode(context)", success) 68 Should("new ChannelSplitterNode(context)", success)
69 .summarize( 69 .summarize(
70 "constructed node with correct attributes", 70 "constructed node with correct attributes",
71 "did not construct correct node correctly") 71 "did not construct correct node correctly")
72 72
73 taskDone(); 73 taskDone();
74 }); 74 });
75 75
76 audit.defineTask("test AudioNodeOptions", function (taskDone) { 76 audit.defineTask("test AudioNodeOptions", function (taskDone) {
77 testAudioNodeOptions(context, "ChannelSplitterNode"); 77 testAudioNodeOptions(context, "ChannelSplitterNode", {
78 expectedChannelCount: {
79 value: 6,
80 isFixed: true,
81 errorType: "InvalidStateError"
82 },
83 expectedChannelCountMode: {
84 value: "explicit",
85 isFixed: true
86 }
87 });
78 taskDone(); 88 taskDone();
79 }); 89 });
80 90
81 audit.defineTask("constructor options", function (taskDone) { 91 audit.defineTask("constructor options", function (taskDone) {
82 var node; 92 var node;
83 var success = true; 93 var success = true;
84 var options = { 94 var options = {
85 numberOfInputs: 3, 95 numberOfInputs: 3,
86 numberOfOutputs: 9, 96 numberOfOutputs: 9,
87 channelInterpretation: "discrete" 97 channelInterpretation: "discrete"
(...skipping 15 matching lines...) Expand all
103 function () { 113 function () {
104 node = new ChannelSplitterNode(context, options); 114 node = new ChannelSplitterNode(context, options);
105 }) 115 })
106 .throw("IndexSizeError") && success; 116 .throw("IndexSizeError") && success;
107 117
108 options = { channelCount: 3 }; 118 options = { channelCount: 3 };
109 success = Should("new ChannelSplitterNode(c, " + JSON.stringify(options) + ")", 119 success = Should("new ChannelSplitterNode(c, " + JSON.stringify(options) + ")",
110 function () { 120 function () {
111 node = new ChannelSplitterNode(context, options); 121 node = new ChannelSplitterNode(context, options);
112 }) 122 })
113 .notThrow() && success; 123 .throw("InvalidStateError") && success;
114 124
115 options = { channelCountMode: "max"}; 125 options = { channelCountMode: "max"};
116 success = Should("new ChannelSplitterNode(c, " + JSON.stringify(options) + ")", 126 success = Should("new ChannelSplitterNode(c, " + JSON.stringify(options) + ")",
117 function () { 127 function () {
118 node = new ChannelSplitterNode(context, { 128 node = new ChannelSplitterNode(context, {
119 channelCountMode: "max" 129 channelCountMode: "max"
120 }); 130 });
121 }) 131 })
122 .notThrow() && success; 132 .throw("InvalidStateError") && success;
123 133
124 Should("new ChannelSplitterNode() with options", success) 134 Should("new ChannelSplitterNode() with options", success)
125 .summarize( 135 .summarize(
126 "constructed with correct attributes", 136 "constructed with correct attributes",
127 "was not constructed correctly"); 137 "was not constructed correctly");
128 138
129 taskDone(); 139 taskDone();
130 }); 140 });
131 141
132 audit.runTasks(); 142 audit.runTasks();
133 </script> 143 </script>
134 </body> 144 </body>
135 </html> 145 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698