blob: 36c97afa2b2731bc61c5e90879adfba964643160 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'"> <!-- Worker should not inherit this policy. -->
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
</script>
</head>
<body>
<p>This tests a Web Worker without a Content Security Policy is allowed to import a script from a different origin through a redirect.</p>
<pre id="result"></pre>
<script>
function reportResultAndNotifyDone(message)
{
document.getElementById("result").textContent = message;
if (window.testRunner)
testRunner.notifyDone();
}
var worker;
try {
worker = new Worker("resources/worker-importScript-redirect-cross-origin-allowed.php");
worker.onmessage = function (event) { reportResultAndNotifyDone(event.data); };
} catch (exception) {
reportResultAndNotifyDone("FAIL should not have thrown an exception when creating worker. Threw exception " + exception + ".");
}
</script>
</body>
</html>