tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

eval-scripts-setInterval-allowed.sub.html (1055B)


      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' 'unsafe-eval'; connect-src 'self';">
      7    <title>eval-scripts-setInterval-allowed</title>
      8    <script src="/resources/testharness.js"></script>
      9    <script src="/resources/testharnessreport.js"></script>
     10    <script src='../support/logTest.sub.js?logs=["PASS 1 of 2","PASS 2 of 2"]'></script>
     11    <script src='../support/alertAssert.sub.js?alerts=[]'></script>
     12 </head>
     13 <pre>
     14 <script>
     15  window.addEventListener('securitypolicyviolation', function(e) {
     16    log("Fail");
     17  });
     18 
     19  var id_string = setInterval("clearInterval(id_string); log('PASS 1 of 2')", 0);
     20  if (id_string == 0)
     21    log('FAIL: Return value for string (should not be 0): ' + id_string);
     22 
     23  var id_function = setInterval(function() {
     24    clearInterval(id_function);
     25    log('PASS 2 of 2');
     26  }, 0);
     27 
     28  if (id_function == 0)
     29    log('FAIL');
     30 </script>
     31 </pre>
     32 
     33 </html>