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

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

Issue 2765443003: CSP: Upstream worker tests to WPT repository. (Closed)
Patch Set: 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/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 3c296800f8f0aed1adeaab34fce5f04d13f3470b..d475d05115a59d0d4630894227e7c0a1ae4304ce 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
@@ -19,6 +19,15 @@ function waitUntilCSPEventForURL(test, url) {
});
}
+function waitUntilCSPEventForEval(test, line) {
+ return new Promise((resolve, reject) => {
+ self.addEventListener("securitypolicyviolation", test.step_func(e => {
+ if (e.blockedURI == "eval" && e.lineNumber == line)
+ resolve(e);
+ }));
+ });
+}
+
function waitUntilEvent(obj, name) {
return new Promise((resolve, reject) => {
obj.addEventListener(name, resolve);

Powered by Google App Engine
This is Rietveld 408576698