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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/testharness-helper.js

Issue 2500383002: CSP: Fire 'securitypolicyviolation' events in Workers. (Closed)
Patch Set: Feedback. 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/resources/testharness-helper.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/testharness-helper.js b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/testharness-helper.js
index a1eaa891e03187e8e81bd86f6adaab4ea425f07a..3c296800f8f0aed1adeaab34fce5f04d13f3470b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/testharness-helper.js
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/testharness-helper.js
@@ -1,5 +1,5 @@
function assert_no_csp_event_for_url(test, url) {
- document.addEventListener("securitypolicyviolation", test.step_func(e => {
+ self.addEventListener("securitypolicyviolation", test.step_func(e => {
if (e.blockedURI !== url)
return;
assert_unreached("SecurityPolicyViolation event fired for " + url);
@@ -12,7 +12,7 @@ function assert_no_event(test, obj, name) {
function waitUntilCSPEventForURL(test, url) {
return new Promise((resolve, reject) => {
- document.addEventListener("securitypolicyviolation", test.step_func(e => {
+ self.addEventListener("securitypolicyviolation", test.step_func(e => {
if (e.blockedURI == url)
resolve(e);
}));
@@ -128,4 +128,3 @@ function assert_service_worker_is_blocked(url, description) {
]);
}, description);
}
-
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/inside-dedicated-worker.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698