diff options
Diffstat (limited to '')
2 files changed, 26 insertions, 0 deletions
diff --git a/testing/web-platform/tests/content-security-policy/reporting/report-uri-from-inline-javascript.html b/testing/web-platform/tests/content-security-policy/reporting/report-uri-from-inline-javascript.html new file mode 100644 index 0000000000..1cb5a2c659 --- /dev/null +++ b/testing/web-platform/tests/content-security-policy/reporting/report-uri-from-inline-javascript.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <title>Violation report is sent from inline javascript.</title> + <!-- CSP headers + Content-Security-Policy: img-src 'none'; report-uri /reporting/resources/report.py?op=put&reportID={{$id}} + --> +</head> +<body> + <script> + // This script block will trigger a violation report. + var i = document.createElement('img'); + i.src = '/security/resources/abe.png'; + document.body.appendChild(i); + </script> + <script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=img-src%20%27none%27'></script> +</body> +</html> diff --git a/testing/web-platform/tests/content-security-policy/reporting/report-uri-from-inline-javascript.html.sub.headers b/testing/web-platform/tests/content-security-policy/reporting/report-uri-from-inline-javascript.html.sub.headers new file mode 100644 index 0000000000..fd2913a39b --- /dev/null +++ b/testing/web-platform/tests/content-security-policy/reporting/report-uri-from-inline-javascript.html.sub.headers @@ -0,0 +1,6 @@ +Expires: Mon, 26 Jul 1997 05:00:00 GMT +Cache-Control: no-store, no-cache, must-revalidate +Cache-Control: post-check=0, pre-check=0, false +Pragma: no-cache +Set-Cookie: report-uri-from-inline-javascript={{$id:uuid()}}; Path=/content-security-policy/reporting/ +Content-Security-Policy: img-src 'none'; report-uri /reporting/resources/report.py?op=put&reportID={{$id}} |