eval-allowed.sub.html (866B)
1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self';"> 6 <!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.--> 7 <title>eval-allowed</title> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="../support/logTest.sub.js?logs=[]"></script> 11 <script src='../support/alertAssert.sub.js?alerts=["PASS (1 of 2)","PASS (2 of 2)"]'></script> 12 </head> 13 14 <body> 15 <script> 16 window.addEventListener('securitypolicyviolation', function(e) { 17 log("Fail"); 18 }); 19 20 eval("alert_assert('PASS (1 of 2)')"); 21 22 window.eval("alert_assert('PASS (2 of 2)')"); 23 </script> 24 <div id="log"></div> 25 </body> 26 27 </html>