Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/violation-line-number-repro.html

Issue 2357323002: Demonstration of edge case where CSP violation reports have incorrect line numbers. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/violation-line-number-repro.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/violation-line-number-repro.html b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/violation-line-number-repro.html
new file mode 100644
index 0000000000000000000000000000000000000000..1c692fd221a053f0d72c80ca3b1e4bc2b4afd95f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/violation-line-number-repro.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' http://localhost:8000">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+ <script>
+ function generateURL(port) {
+ return 'http://localhost:' + port + '/security/contentSecurityPolicy/resources/loaded.js';
+ }
+
+ document.write("<scr" + "ipt src='" + generateURL("8000") + "'></scr" + "ipt>");
+
+ async_test(function (t) {
+ document.addEventListener("securitypolicyviolation", t.step_func_done(e => { assert_equals(e.lineNumber, 18); }));
+ document.write("<scr" + "ipt src='" + generateURL("8001") + "'></scr" + "ipt>");
+ });
+
+ </script>
+</body>
+</html>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698