OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 <html> |
| 3 <head> |
| 4 <script src="resources/webaudio/compatibility.js"></script> |
| 5 <script src="resources/webaudio/media-element-audio-source-node-test.js"></s
cript> |
| 6 <script src="resources/webaudio/js-test.js"></script> |
| 7 </head> |
| 8 |
| 9 <body> |
| 10 <div id="description"></div> |
| 11 <div id="console"></div> |
| 12 |
| 13 <script> |
| 14 description("MediaElementAudioSourceNode with cross-origin source"); |
| 15 |
| 16 var src = "http://localhost:8000/security/resources/webaudio/laughter.wav"
; |
| 17 var data; |
| 18 |
| 19 function checkResult (e) { |
| 20 data = e.renderedBuffer.getChannelData(0); |
| 21 var count = 0; |
| 22 |
| 23 // Count the number of non-zero values. Since this is a cross-origin sou
rce, all the values |
| 24 // should be zero. |
| 25 for (var k = 0; k < data.length; ++k) { |
| 26 if (data[k] != 0) { |
| 27 ++count; |
| 28 } |
| 29 } |
| 30 if (count > 0) { |
| 31 testFailed("Expected all zeros but found " + count + " non-zero valu
es out of " + data.length + "."); |
| 32 } else { |
| 33 testPassed("All samples correctly zeroed."); |
| 34 } |
| 35 } |
| 36 |
| 37 runTest(src, checkResult); |
| 38 |
| 39 </script> |
| 40 </body> |
| 41 </html> |
OLD | NEW |