blob: 02e74899a8e9c65d5a4c0c2f7f5d7339de09a8b2 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/js-test-pre.js"></script>
</head>
<body>
<script>
window.jsTestIsAsync = true;
description("This tests that Web Worker script redirects are blocked if cross origin.");
var worker;
shouldNotThrow('worker = new Worker("http://127.0.0.1:8000/resources/redirect.py?url=http://localhost:8000/security/resources/worker-message-pass.js")');
worker.onmessage = function(event) {
testFailed("Should have blocked cross origin Worker script load");
finishJSTest();
};
worker.onerror = function () {
testPassed("Blocked cross origin Worker script load");
finishJSTest();
};
</script>
<script src="/js-test-resources/js-test-post.js"></script>
</body>
</html>