Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(t => {
let violationCount = 0;
document.addEventListener('securitypolicyviolation',
t.step_func(() => violationCount++));
return CSS.paintWorklet.addModule(
.then(() => {}, () => assert_unreached(
'addModule should succeed since the policy is report-only.'))
.then(() => new Promise(resolve => t.step_timeout(resolve, 0)))
.then(() => assert_equals(violationCount, 1));
}, 'A CSP violation under report-only policy for a worklet\'s top-level ' +
'module script dispatches one securitypolicyviolation event');
</script>