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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-blocked-when-target-blank.html

Issue 2487973004: Enforce form-action CSP even when form.target is present. (Closed)
Patch Set: Created 4 years, 1 month 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-blocked-when-target-blank.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-blocked-when-target-blank.html
similarity index 56%
copy from third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html
copy to third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-blocked-when-target-blank.html
index 3c75ac11af13d7b9682f8aca4ed56e793cb5fdbb..09103f5b1998e37db283dc7e0ddd65e98cab7ef4 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-blocked-when-target-blank.html
@@ -9,18 +9,31 @@
testRunner.clearBackForwardList();
testRunner.dumpBackForwardList();
}
+
window.addEventListener('load', function() {
+ document.getElementById('theform').addEventListener('submit', function(e) {
+ console.log('submit event fired.');
+ });
+
setTimeout(function() {
document.getElementById('submit').click();
}, 0);
});
- setTimeout(function () {
- testRunner.notifyDone();
- }, 1000);
+
+ document.addEventListener('securitypolicyviolation', function(e) {
+ console.log('securitypolicyviolation event fired.');
+ console.log('securitypolicyviolation_event.documentURI=' + e.documentURI);
+ console.log('securitypolicyviolation_event.blockedURI=' + e.blockedURI);
+ console.log('securitypolicyviolation_event.violatedDirective=' + e.violatedDirective);
+ setTimeout(function() {
+ testRunner.notifyDone();
+ }, 0);
+ });
</script>
</head>
<body>
- <form action='/navigation/resources/form-target.pl' id='theform' method='post'>
+ <form action='/navigation/resources/form-target.pl' id='theform'
+ method='post' target="_blank">
<input type='text' name='fieldname' value='fieldvalue'>
<input type='submit' id='submit' value='submit'>
</form>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-blocked-when-target-blank-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698