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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/form-action-none-and-reload.html

Issue 2737343004: CSP: A new set of test with form resubmission. (Closed)
Patch Set: Use testharness for main page form resubmission. Created 3 years, 9 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
Index: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/form-action-none-and-reload.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/form-action-none-and-reload.html b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/form-action-none-and-reload.html
new file mode 100644
index 0000000000000000000000000000000000000000..94942aed0f1c45f67c7fb0ad915af0863f2e9265
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/form-action-none-and-reload.html
@@ -0,0 +1,23 @@
+<html>
+ <head>
+ <meta http-equiv="Content-Security-Policy" content="form-action 'none'">
+ </head>
+ <body>
+ <script>
+ window.addEventListener('securitypolicyviolation', function(event) {
+ // Notify the parent frame or the parent window that the reload was
+ // blocked by the CSP.
+ let data = {
+ "blockedURI":event.blockedURI,
+ "effectiveDirective":event.effectiveDirective
+ };
+ if (window.opener)
+ window.opener.postMessage(data, "*");
+ else if (window.parent != window)
+ window.parent.postMessage(data, "*");
+ });
+
+ location.reload();
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698