| <meta http-equiv="Content-Security-Policy" content="script-src 'unsafe-inline'"> |
| testRunner.waitUntilDone(); |
| <p>This tests that the Content Security Policy (CSP) of the owner document (this page) blocks a file-URL Web Worker from using <code>eval()</code> because the parent's CSP does not list <code>unsafe-eval</code> in script-src.</p> |
| window.onmessage = function (event) |
| document.getElementById("result").textContent = event.data; |
| worker = new Worker("resources/worker-inherits-blocks-eval.js"); |
| worker.onmessage = function (event) { window.postMessage(event.data, "*") }; |
| window.postMessage("FAIL should not have thrown an exception when creating worker. Threw exception " + exception + ".", "*"); |