OLD | NEW |
(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(); |
OLD | NEW |