| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta http-equiv="Content-Security-Policy" content="child-src http://127.0.0.1:8000/resources/redirect.php"> |
| <script src="/js-test-resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| window.jsTestIsAsync = true; |
| |
| description("This tests that the Content Security Policy of the page allows loading a Web Worker's script redirected on the same origin."); |
| |
| var worker; |
| shouldNotThrow('worker = new Worker("http://127.0.0.1:8000/resources/redirect.php?url=http://127.0.0.1:8000/security/resources/worker-message-pass.js")'); |
| worker.onmessage = function(event) { |
| testPassed(event.data); |
| finishJSTest(); |
| }; |
| worker.onerror = function () { |
| testFailed("error event dispatched"); |
| finishJSTest(); |
| }; |
| </script> |
| <script src="/js-test-resources/js-test-post.js"></script> |
| </body> |
| </html> |