OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 <script src="resources/compatibility.js"></script> | 5 <script src="resources/compatibility.js"></script> |
6 <script src="resources/audio-testing.js"></script> | 6 <script src="resources/audio-testing.js"></script> |
7 <title>Test Basic Functionality of AudioBuffer.copyFromChannel and AudioBuff
er.copyToChannel</title> | 7 <title>Test Basic Functionality of AudioBuffer.copyFromChannel and AudioBuff
er.copyToChannel</title> |
8 </head> | 8 </head> |
9 | 9 |
10 <body> | 10 <body> |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // Test that expected exceptions are signaled for copyFrom. | 105 // Test that expected exceptions are signaled for copyFrom. |
106 audit.defineTask("copyFrom-exceptions", function (done) { | 106 audit.defineTask("copyFrom-exceptions", function (done) { |
107 shouldBeDefined("AudioBuffer.prototype.copyFromChannel"); | 107 shouldBeDefined("AudioBuffer.prototype.copyFromChannel"); |
108 | 108 |
109 Should("buffer = context.createBuffer(" + numberOfChannels + ", " + buff
erLength + ", context.sampleRate)", | 109 Should("buffer = context.createBuffer(" + numberOfChannels + ", " + buff
erLength + ", context.sampleRate)", |
110 function () { | 110 function () { |
111 buffer = context.createBuffer(numberOfChannels, bufferLength, contex
t.sampleRate); | 111 buffer = context.createBuffer(numberOfChannels, bufferLength, contex
t.sampleRate); |
112 }).notThrow(); | 112 }).notThrow(); |
113 Should("buffer.copyFromChannel(null, 0)", function () { | 113 Should("buffer.copyFromChannel(null, 0)", function () { |
114 buffer.copyFromChannel(null, 0); | 114 buffer.copyFromChannel(null, 0); |
115 }).throw("TypeMismatchError"); | 115 }).throw("TypeError"); |
116 Should("buffer.copyFromChannel(context, 0)", function () { | 116 Should("buffer.copyFromChannel(context, 0)", function () { |
117 buffer.copyFromChannel(context, 0); | 117 buffer.copyFromChannel(context, 0); |
118 }).throw("TypeMismatchError"); | 118 }).throw("TypeError"); |
119 Should("buffer.copyFromChannel(x, -1)", function () { | 119 Should("buffer.copyFromChannel(x, -1)", function () { |
120 buffer.copyFromChannel(x, -1); | 120 buffer.copyFromChannel(x, -1); |
121 }).throw("IndexSizeError"); | 121 }).throw("IndexSizeError"); |
122 Should("buffer.copyFromChannel(x, " + numberOfChannels + ")", function (
) { | 122 Should("buffer.copyFromChannel(x, " + numberOfChannels + ")", function (
) { |
123 buffer.copyFromChannel(x, numberOfChannels); | 123 buffer.copyFromChannel(x, numberOfChannels); |
124 }).throw("IndexSizeError");; | 124 }).throw("IndexSizeError");; |
125 Should("buffer.copyFromChannel(x, 0, -1)", function () { | 125 Should("buffer.copyFromChannel(x, 0, -1)", function () { |
126 buffer.copyFromChannel(x, 0, -1); | 126 buffer.copyFromChannel(x, 0, -1); |
127 }).throw("IndexSizeError"); | 127 }).throw("IndexSizeError"); |
128 Should("buffer.copyFromChannel(x, 0, " + bufferLength + ")", function ()
{ | 128 Should("buffer.copyFromChannel(x, 0, " + bufferLength + ")", function ()
{ |
129 buffer.copyFromChannel(x, 0, bufferLength); | 129 buffer.copyFromChannel(x, 0, bufferLength); |
130 }).throw("IndexSizeError"); | 130 }).throw("IndexSizeError"); |
131 | 131 |
132 shouldThrow("buffer.copyFromChannel(x, 3)"); | 132 shouldThrow("buffer.copyFromChannel(x, 3)"); |
133 | 133 |
134 done(); | 134 done(); |
135 }); | 135 }); |
136 | 136 |
137 // Test that expected exceptions are signaled for copyTo. | 137 // Test that expected exceptions are signaled for copyTo. |
138 audit.defineTask("copyTo-exceptions", function (done) { | 138 audit.defineTask("copyTo-exceptions", function (done) { |
139 shouldBeDefined("AudioBuffer.prototype.copyToChannel"); | 139 shouldBeDefined("AudioBuffer.prototype.copyToChannel"); |
140 Should("buffer.copyToChannel(null, 0)", function () { | 140 Should("buffer.copyToChannel(null, 0)", function () { |
141 buffer.copyToChannel(null, 0); | 141 buffer.copyToChannel(null, 0); |
142 }).throw("TypeMismatchError"); | 142 }).throw("TypeError"); |
143 Should("buffer.copyToChannel(context, 0)", function () { | 143 Should("buffer.copyToChannel(context, 0)", function () { |
144 buffer.copyToChannel(context, 0); | 144 buffer.copyToChannel(context, 0); |
145 }).throw("TypeMismatchError"); | 145 }).throw("TypeError"); |
146 Should("buffer.copyToChannel(x, -1)", function () { | 146 Should("buffer.copyToChannel(x, -1)", function () { |
147 buffer.copyToChannel(x, -1); | 147 buffer.copyToChannel(x, -1); |
148 }).throw("IndexSizeError"); | 148 }).throw("IndexSizeError"); |
149 Should("buffer.copyToChannel(x, " + numberOfChannels + ")", function ()
{ | 149 Should("buffer.copyToChannel(x, " + numberOfChannels + ")", function ()
{ |
150 buffer.copyToChannel(x, numberOfChannels); | 150 buffer.copyToChannel(x, numberOfChannels); |
151 }).throw("IndexSizeError"); | 151 }).throw("IndexSizeError"); |
152 Should("buffer.copyToChannel(x, 0, -1)", function () { | 152 Should("buffer.copyToChannel(x, 0, -1)", function () { |
153 buffer.copyToChannel(x, 0, -1); | 153 buffer.copyToChannel(x, 0, -1); |
154 }).throw("IndexSizeError"); | 154 }).throw("IndexSizeError"); |
155 Should("buffer.copyToChannel(x, 0, " + bufferLength + ")", function () { | 155 Should("buffer.copyToChannel(x, 0, " + bufferLength + ")", function () { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 audit.runTasks( | 251 audit.runTasks( |
252 "initialize", | 252 "initialize", |
253 "copyFrom-exceptions", | 253 "copyFrom-exceptions", |
254 "copyTo-exceptions", | 254 "copyTo-exceptions", |
255 "copyFrom-validate", | 255 "copyFrom-validate", |
256 "copyTo-validate", | 256 "copyTo-validate", |
257 "finish" | 257 "finish" |
258 ); | 258 ); |
259 | 259 |
260 successfullyParsed = true; | 260 successfullyParsed = true; |
261 | 261 |
262 </script> | 262 </script> |
263 | 263 |
264 </body> | 264 </body> |
265 </html> | 265 </html> |
OLD | NEW |