| <!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> |