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