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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/script-src-allow.sub.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/inside-worker/support/script-src-allow.sub.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/script-src-allow.sub.js b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/script-src-allow.sub.js
new file mode 100644
index 0000000000000000000000000000000000000000..1f7d7ab91335cb3ca8d122463e42003d9927e9d4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/script-src-allow.sub.js
@@ -0,0 +1,18 @@
+importScripts("{{location[server]}}/resources/testharness.js");
+
+test(t => {
+ importScripts("http://{{domains[www]}}:{{ports[http][1]}}/content-security-policy/support/testharness-helper.js");
+}, "Cross-origin `importScripts()` not blocked in " + self.location.protocol + self.location.search);
+
+test(t => {
+ assert_equals(2, eval("1+1"));
+ assert_equals(2, (new Function("return 1+1;"))());
+}, "`eval()` not blocked in " + self.location.protocol + self.location.search);
+
+async_test(t => {
+ self.callback = t.step_func_done();
+
+ setTimeout("self.callback();", 1);
+}, "`setTimeout([string])` not blocked in " + self.location.protocol + self.location.search);
+
+done();

Powered by Google App Engine
This is Rietveld 408576698