tor-browser

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

import-scripts-resource-map.https.html (1430B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8" />
      3 <title>Tests for importScripts: script resource map</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="resources/test-helpers.sub.js"></script>
      7 <body>
      8  <script>
      9    // This test registers a worker that imports a script multiple times. The
     10    // script should be stored on the first import and thereafter that stored
     11    // script should be loaded. The worker asserts that the stored script was
     12    // loaded; if the assert fails then registration fails.
     13 
     14    promise_test(async t => {
     15      const SCOPE = "resources/import-scripts-resource-map";
     16      const SCRIPT = "resources/import-scripts-resource-map-worker.js";
     17      await service_worker_unregister(t, SCOPE);
     18      const registration = await navigator.serviceWorker.register(SCRIPT, {
     19        scope: SCOPE
     20      });
     21      await registration.unregister();
     22    }, "import the same script URL multiple times");
     23 
     24    promise_test(async t => {
     25      const SCOPE = "resources/import-scripts-diff-resource-map";
     26      const SCRIPT = "resources/import-scripts-diff-resource-map-worker.js";
     27      await service_worker_unregister(t, SCOPE);
     28      const registration = await navigator.serviceWorker.register(SCRIPT, {
     29        scope: SCOPE
     30      });
     31      await registration.unregister();
     32    }, "call importScripts() with multiple arguments");
     33  </script>
     34 </body>