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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/workers/resources/script-src-self.js

Issue 2540983003: CSP: Dedicated workers always inherit policy. (Closed)
Patch Set: Rebase. 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 unified diff | Download patch
OLDNEW
(Empty)
1 importScripts("http://127.0.0.1:8000/resources/testharness.js");
2 importScripts("http://127.0.0.1:8000/security/contentSecurityPolicy/resources/te stharness-helper.js");
3
4 test(t => {
5 // TODO(mkwst): The error event isn't firing. :/
6
7 assert_throws(EvalError(),
8 function () { eval("1 + 1"); },
9 "`eval()` should throw 'EvalError'.");
10
11 assert_throws(EvalError(),
12 function () { var x = new Function("1 + 1"); },
13 "`new Function()` should throw 'EvalError'.");
14 }, "`eval()` blocked in " + self.location.protocol);
15
16 async_test(t => {
17 waitUntilCSPEventForEval(t, 21)
18 .then(_ => t.done());
19
20 assert_equals(
21 setTimeout("assert_unreached('setTimeout([string]) should not execute.')", 0),
22 0);
23 }, "`setTimeout([string])` blocked in " + self.location.protocol);
24
25 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698