| Index: LayoutTests/http/tests/security/media-element-audio-source-node-cross-origin-allowed.html
|
| diff --git a/LayoutTests/http/tests/security/media-element-audio-source-node-cross-origin-allowed.html b/LayoutTests/http/tests/security/media-element-audio-source-node-cross-origin-allowed.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ce2dbb8cd351a3640d29dc9521a9ca2cf4155618
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/security/media-element-audio-source-node-cross-origin-allowed.html
|
| @@ -0,0 +1,46 @@
|
| +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
| +<html>
|
| + <head>
|
| + <script src="resources/webaudio/compatibility.js"></script>
|
| + <script src="resources/webaudio/media-element-audio-source-node-test.js"></script>
|
| + <script src="resources/webaudio/js-test.js"></script>
|
| + </head>
|
| +
|
| + <body>
|
| + <div id="description"></div>
|
| + <div id="console"></div>
|
| +
|
| + <script>
|
| + description("MediaElementAudioSourceNode with cross-origin source");
|
| +
|
| + var data;
|
| +
|
| + function checkResult (e) {
|
| + data = e.renderedBuffer.getChannelData(0);
|
| + var count = 0;
|
| +
|
| + // Count the number of non-zero values. Since this is a cross-origin source that is allowed,
|
| + // there should be at least one non-zero value.
|
| + for (var k = 0; k < data.length; ++k) {
|
| + if (data[k] != 0) {
|
| + ++count;
|
| + }
|
| + }
|
| + if (count > 0) {
|
| + testPassed("Correctly found some non-zero values.");
|
| + } else {
|
| + testFailed("All samples incorrectly zeroed.");
|
| + }
|
| + }
|
| +
|
| + function testFunction() {
|
| + audio.crossOrigin = "anonymous";
|
| + audio.src =
|
| + "http://localhost:8000/security/resources/webaudio/media-element-cross-origin-allow.php";
|
| + }
|
| +
|
| + runTest(null, checkResult, testFunction);
|
| +
|
| + </script>
|
| + </body>
|
| +</html>
|
|
|