blob: a166ec87bd5f0e88de34dc25d8f05e13aad4e92a [file] [log] [blame]
<!doctype html>
<html>
<head>
<script src="resources/webaudio/compatibility.js"></script>
<script src="resources/webaudio/media-element-audio-source-node-test.js"></script>
<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description("MediaElementAudioSourceNode with redirection");
var src = "/serviceworker/resources/redirect.php?Redirect=http://localhost:8000/security/resources/webaudio/laughter.wav";
var data;
function checkResult (e) {
data = e.getChannelData(0);
var count = 0;
// Count the number of non-zero values. Since this is a cross-origin source, all the values
// should be zero.
for (var k = 0; k < data.length; ++k) {
if (data[k] != 0) {
++count;
}
}
if (count > 0) {
testFailed("Expected all zeros but found " + count + " non-zero values out of " + data.length + ".");
} else {
testPassed("All samples correctly zeroed.");
}
}
runTest(src, checkResult);
</script>
</body>
</html>