tor-browser

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

test_strict_mode_warning.html (1166B)


      1 <!--
      2  Any copyright is dedicated to the Public Domain.
      3  http://creativecommons.org/publicdomain/zero/1.0/
      4 -->
      5 <!DOCTYPE HTML>
      6 <html>
      7 <head>
      8  <title>Bug 1170550 - test registration of service worker scripts with a strict mode warning</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     11 </head>
     12 <body>
     13 <p id="display"></p>
     14 <div id="content" style="display: none">
     15 </div>
     16 <pre id="test"></pre>
     17 <script class="testbody" type="text/javascript">
     18 
     19  function runTest() {
     20    navigator.serviceWorker
     21      .register("strict_mode_warning.js", {scope: "strict_mode_warning"})
     22      .then((reg) => {
     23        ok(true, "Registration should not fail for warnings");
     24        return reg.unregister();
     25      })
     26      .then(() => {
     27        SimpleTest.finish();
     28      });
     29  }
     30 
     31  SimpleTest.waitForExplicitFinish();
     32  onload = function() {
     33    SpecialPowers.pushPrefEnv({"set": [
     34      ["dom.serviceWorkers.exemptFromPerDomainMax", true],
     35      ["dom.serviceWorkers.enabled", true],
     36      ["dom.serviceWorkers.testing.enabled", true],
     37    ]}, runTest);
     38  };
     39 </script>
     40 </pre>
     41 </body>
     42 </html>