tor-browser

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

browser_data_documents_aboutmemory.js (606B)


      1 add_task(async function () {
      2  const doc = new DOMParser().parseFromString("<p>dadada</p>", "text/html");
      3 
      4  let mgr = Cc["@mozilla.org/memory-reporter-manager;1"].getService(
      5    Ci.nsIMemoryReporterManager
      6  );
      7 
      8  let amount = 0;
      9  const handleReport = (aProcess, aPath, aKind, aUnits, aAmount) => {
     10    const regex = new RegExp(".*/window-objects/.*/data-documents/.*");
     11    if (regex.test(aPath)) {
     12      amount += aAmount;
     13    }
     14  };
     15 
     16  await new Promise(r =>
     17    mgr.getReports(handleReport, null, r, null, /* anonymized = */ false)
     18  );
     19  Assert.greater(amount, 0, "Got data documents amount");
     20 });