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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-resubmission-iframe-reload-from-child.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/1.1/form-action-resubmission-iframe-reload-from-child.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-resubmission-iframe-reload-from-child.html b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-resubmission-iframe-reload-from-child.html
new file mode 100644
index 0000000000000000000000000000000000000000..4b4011f4a7029e368af5be3f4c3590ca23232854
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-resubmission-iframe-reload-from-child.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!--
+ This test documents the current behavior with Content-Security-Policy and
+ form resubmission. It makes a first navigation with a form submission in an
+ iframe, then the iframe reloads itself. This is a form resubmission. The
+ thing is that the iframe has set the "form-action 'none'" policy and so the
+ reload is blocked.
+-->
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<html>
+ <body>
+ <iframe name="iframe" id="iframe"></iframe>
+
+ <form
+ id="form"
+ method="post"
+ target="iframe"
+ action="/security/contentSecurityPolicy/resources/form-action-none-and-reload.html">
+ </form>
+
+ <script>
+ async_test(t => {
+ window.addEventListener("message", t.step_func(e => {
+ assert_equals(e.source, document.getElementById("iframe").contentWindow);
+ assert_equals(e.data.effectiveDirective, "form-action");
+ assert_equals(e.data.blockedURI, location.origin + "/security/contentSecurityPolicy/resources/form-action-none-and-reload.html");
+ t.done();
+ }));
+ document.getElementById("form").submit();
+ }, "The form resubmission should be blocked by the iframe's CSP.");
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-resubmission-iframe-reload-from-child-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698