blob: 104ca48e25f86656152b8b7b3640fa794ceae0b9 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/testharness.js"></script>
<script src="/js-test-resources/testharnessreport.js"></script>
</head>
<body>
<script>
async_test(function () {
var worker = new Worker('http://127.0.0.1:8000/security/contentSecurityPolicy/resources/worker.php?type=multiple-headers');
var evalBlocked = false;
var xhrBlocked = false;
var numMessages = 0;
worker.onmessage = this.step_func(function (event) {
numMessages++;
if (event.data === "xhr blocked")
xhrBlocked = true;
if (event.data === "eval blocked")
evalBlocked = true;
if (numMessages === 2) {
assert_true(xhrBlocked);
assert_true(evalBlocked);
this.done();
}
});
}, "Worker can have multiple CSP headers");
</script>
</body>
</html>