tor-browser

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

browser_bytecode_cache_asm_js.js (761B)


      1 "use strict";
      2 
      3 const PAGE_URL =
      4  "http://example.com/browser/dom/tests/browser/page_bytecode_cache_asm_js.html";
      5 
      6 add_task(async function () {
      7  // Eagerly generate bytecode cache.
      8  await SpecialPowers.pushPrefEnv({
      9    set: [
     10      ["dom.script_loader.bytecode_cache.enabled", true],
     11      ["dom.script_loader.bytecode_cache.strategy", -1],
     12    ],
     13  });
     14 
     15  await BrowserTestUtils.withNewTab(
     16    {
     17      gBrowser,
     18      url: PAGE_URL,
     19      waitForLoad: true,
     20    },
     21    async browser => {
     22      let result = await SpecialPowers.spawn(browser, [], () => {
     23        return content.document.getElementById("result").textContent;
     24      });
     25      // No error shoud be caught by content.
     26      is(result, "ok");
     27    }
     28  );
     29 
     30  await SpecialPowers.popPrefEnv();
     31 });