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>
<meta http-equiv="Content-Security-Policy" content="require-sri-for 'script'">
<script src="/content-security-policy/resources/ran.js"></script>
<script>
promise_test(async t => {
const watcher = new EventWatcher(t, document, ['securitypolicyviolation']);
const e = await watcher.wait_for('securitypolicyviolation');
assert_equals(e.blockedURI, `${location.origin}/content-security-policy/resources/ran.js`);
assert_true(typeof(window.ran) == "undefined", "Script did not ran");
}, "Test that meta require-sri-for blocks scripts with no SRI");
</script>