blob: 3f7856dbdb2d7c26e8f43b080f38915312c21cff [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="script-src 'unsafe-eval' 'unsafe-inline' 127.0.0.1:8000"/>
<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
<script>
window.jsTestIsAsync = true;
window.wasPostTestScriptParsed = true;
var result = '';
try {
var worker = new Worker('http://127.0.0.1:8000/security/contentSecurityPolicy/resources/worker.php?type=importscripts&csp=' +
encodeURIComponent("script-src 'unsafe-eval' 'unsafe-inline' 127.0.0.1:8000"));
worker.onmessage = function (event) {
result = event.data;
shouldBeEqualToString('result', 'importScripts blocked: NetworkError: A network error occurred.');
finishJSTest();
};
} catch (e) {
result = e;
shouldBeEqualToString('result', 'importScripts blocked');
finishJSTest();
}
</script>
</body>
</html>