tor-browser

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

test_link_relList_supports_manifest.html (1310B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1596040
      5 -->
      6 
      7 <head>
      8  <meta charset="utf-8">
      9  <title>Test for Bug 1596040 - Link relList support returns false for manifest</title>
     10  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     11  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
     12  <script>
     13  "use strict";
     14  SimpleTest.waitForExplicitFinish();
     15 
     16  async function run() {
     17    const prefSetting = [
     18      { manifest: true, modulepreload: true },
     19      { manifest: true, modulepreload: false },
     20      { manifest: false, modulepreload: true },
     21      { manifest: false, modulepreload: false },
     22    ];
     23    for (const { manifest, modulepreload } of prefSetting) {
     24      await SpecialPowers.pushPrefEnv({
     25        set: [
     26          ["dom.manifest.enabled", manifest],
     27          ["network.modulepreload", modulepreload],
     28        ],
     29      });
     30      const { relList } = document.createElement("link");
     31      is(
     32        relList.supports("manifest"),
     33        manifest,
     34        `Expected manifest to be ${manifest}`
     35      );
     36      is(
     37        relList.supports("modulepreload"),
     38        modulepreload,
     39        `Expected preload to be ${modulepreload}`
     40      );
     41    }
     42  }
     43  run()
     44    .catch(console.error)
     45    .finally(() => SimpleTest.finish());
     46  </script>
     47 </head>