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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/testharness-helper.js

Issue 2711913003: Upstream Blink's 'securitypolicyviolation' tests. (Closed)
Patch Set: MANIFEST Created 3 years, 10 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/external/wpt/content-security-policy/support/testharness-helper.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/testharness-helper.js b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/testharness-helper.js
index a1eaa891e03187e8e81bd86f6adaab4ea425f07a..3c296800f8f0aed1adeaab34fce5f04d13f3470b 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/testharness-helper.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/support/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);
}
-

Powered by Google App Engine
This is Rietveld 408576698