Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

  • This WPT test may be referenced by the following Test IDs:
<!doctype html>
<meta http-equiv="Content-Security-Policy" content="script-src 'nonce-abc'; style-src 'self'">
<script nonce="abc" src="/resources/testharness.js"></script>
<script nonce="abc" src="/resources/testharnessreport.js"></script>
<script nonce="abc">
promise_test(async t => {
const timeout_promise = () => new Promise(resolve => t.step_timeout(resolve, 1000));
return new EventWatcher(t, document, ["securitypolicyviolation"], timeout_promise)
.wait_for("securitypolicyviolation").then(e => {
test(() => assert_equals(e.blockedURI, "inline"));
test(() => assert_equals(e.lineNumber, 20));
test(() => assert_in_array(e.columnNumber, [1, 21]));
test(() => assert_equals(e.target, document.getElementById("target")));
});
});
</script>
<script id="target">
test(() => unexecuted_test.assert_unreached("This code block should not execute."));
</script>