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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.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-src-blocked.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-src-blocked.html
index 3c75ac11af13d7b9682f8aca4ed56e793cb5fdbb..b5bc0a3f413e1e946148975be530dccdfaf946d0 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-src-blocked.html
@@ -9,14 +9,26 @@
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>

Powered by Google App Engine
This is Rietveld 408576698