tor-browser

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

test_bug1240436.html (1017B)


      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>Test for encoding of service workers</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"></div>
     15 <pre id="test"></pre>
     16 <script class="testbody" type="text/javascript">
     17  SimpleTest.waitForExplicitFinish();
     18 
     19  function runTest() {
     20    navigator.serviceWorker.register("bug1240436_worker.js")
     21      .then(reg => reg.unregister())
     22      .then(() => ok(true, "service worker register script succeed"))
     23      .catch(err => ok(false, "service worker register script faled " + err))
     24      .then(() => SimpleTest.finish());
     25  }
     26 
     27  SpecialPowers.pushPrefEnv({"set": [
     28    ["dom.serviceWorkers.enabled", true],
     29    ["dom.serviceWorkers.testing.enabled", true]
     30  ]}, runTest);
     31 </script>
     32 </pre>
     33 </body>
     34 </html>