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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-copy-channel.html

Issue 2812833003: Revert of [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/testharness.js"></script> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="../resources/audit-util.js"></script> 6 <script src="../resources/audit-util.js"></script>
7 <script src="../resources/audit.js"></script> 7 <script src="../resources/audit.js"></script>
8 <title>Test Basic Functionality of AudioBuffer.copyFromChannel and AudioBuff er.copyToChannel</title> 8 <title>Test Basic Functionality of AudioBuffer.copyFromChannel and AudioBuff er.copyToChannel</title>
9 </head> 9 </head>
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 should(() => { 139 should(() => {
140 buffer.copyFromChannel(x, 0, bufferLength); 140 buffer.copyFromChannel(x, 0, bufferLength);
141 }, "6: buffer.copyFromChannel(x, 0, " + bufferLength + ")") 141 }, "6: buffer.copyFromChannel(x, 0, " + bufferLength + ")")
142 .throw("IndexSizeError"); 142 .throw("IndexSizeError");
143 143
144 should(() => { 144 should(() => {
145 buffer.copyFromChannel(x, 3); 145 buffer.copyFromChannel(x, 3);
146 }, "7: buffer.copyFromChannel(x, 3)") 146 }, "7: buffer.copyFromChannel(x, 3)")
147 .throw("IndexSizeError"); 147 .throw("IndexSizeError");
148 148
149 if (window.SharedArrayBuffer) {
150 var shared_buffer = new Float32Array(new SharedArrayBuffer(32));
151 should(() => {
152 buffer.copyFromChannel(shared_buffer, 0);
153 }, "8: buffer.copyFromChannel(SharedArrayBuffer view, 0)")
154 .throw("TypeError");
155
156 should(() => {
157 buffer.copyFromChannel(shared_buffer, 0, 0);
158 }, "9: buffer.copyFromChannel(SharedArrayBuffer view, 0, 0)")
159 .throw("TypeError");
160 }
161
162 task.done(); 149 task.done();
163 }); 150 });
164 151
165 // Test that expected exceptions are signaled for copyTo. 152 // Test that expected exceptions are signaled for copyTo.
166 audit.define("copyTo-exceptions", (task, should) => { 153 audit.define("copyTo-exceptions", (task, should) => {
167 should(AudioBuffer.prototype.copyToChannel, 154 should(AudioBuffer.prototype.copyToChannel,
168 "AudioBuffer.prototype.copyToChannel") 155 "AudioBuffer.prototype.copyToChannel")
169 .exist(); 156 .exist();
170 should(() => { 157 should(() => {
171 buffer.copyToChannel(null, 0); 158 buffer.copyToChannel(null, 0);
(...skipping 18 matching lines...) Expand all
190 should(() => { 177 should(() => {
191 buffer.copyToChannel(x, 0, bufferLength); 178 buffer.copyToChannel(x, 0, bufferLength);
192 }, "5: buffer.copyToChannel(x, 0, " + bufferLength + ")") 179 }, "5: buffer.copyToChannel(x, 0, " + bufferLength + ")")
193 .throw("IndexSizeError"); 180 .throw("IndexSizeError");
194 181
195 should(() => { 182 should(() => {
196 buffer.copyToChannel(x, 3); 183 buffer.copyToChannel(x, 3);
197 }, "6: buffer.copyToChannel(x, 3)") 184 }, "6: buffer.copyToChannel(x, 3)")
198 .throw("IndexSizeError"); 185 .throw("IndexSizeError");
199 186
200 if (window.SharedArrayBuffer) {
201 var shared_buffer = new Float32Array(new SharedArrayBuffer(32));
202 should(() => {
203 buffer.copyToChannel(shared_buffer, 0);
204 }, "7: buffer.copyToChannel(SharedArrayBuffer view, 0)")
205 .throw("TypeError");
206
207 should(() => {
208 buffer.copyToChannel(shared_buffer, 0, 0);
209 }, "8: buffer.copyToChannel(SharedArrayBuffer view, 0, 0)")
210 .throw("TypeError");
211 }
212
213 task.done(); 187 task.done();
214 }); 188 });
215 189
216 // Test copyFromChannel 190 // Test copyFromChannel
217 audit.define("copyFrom-validate", (task, should) => { 191 audit.define("copyFrom-validate", (task, should) => {
218 // Initialize the AudioBuffer to a ramp for testing copyFrom. 192 // Initialize the AudioBuffer to a ramp for testing copyFrom.
219 initializeAudioBufferRamp(buffer); 193 initializeAudioBufferRamp(buffer);
220 194
221 // Test copyFrom operation with a short destination array, filling the d estination completely. 195 // Test copyFrom operation with a short destination array, filling the d estination completely.
222 for (var c = 0; c < numberOfChannels; ++c) { 196 for (var c = 0; c < numberOfChannels; ++c) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 273 }
300 274
301 task.done(); 275 task.done();
302 }); 276 });
303 277
304 audit.run(); 278 audit.run();
305 </script> 279 </script>
306 280
307 </body> 281 </body>
308 </html> 282 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698