tor-browser

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

test_HeapAnalyses_takeCensus_02.js (736B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 "use strict";
      4 
      5 // Test that the HeapAnalyses{Client,Worker} can take censuses with breakdown
      6 // options.
      7 
      8 add_task(async function () {
      9  const client = new HeapAnalysesClient();
     10 
     11  const snapshotFilePath = saveNewHeapSnapshot();
     12  await client.readHeapSnapshot(snapshotFilePath);
     13  ok(true, "Should have read the heap snapshot");
     14 
     15  const { report } = await client.takeCensus(snapshotFilePath, {
     16    breakdown: { by: "count", count: true, bytes: true },
     17  });
     18 
     19  ok(report, "Should get a report");
     20  equal(typeof report, "object", "report should be an object");
     21 
     22  ok(report.count);
     23  ok(report.bytes);
     24 
     25  client.destroy();
     26 });