tor-browser

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

test_HeapAnalyses_getDominatorTree_02.js (766B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 "use strict";
      4 
      5 // Test the HeapAnalyses{Client,Worker} "getDominatorTree" request with bad
      6 // dominator tree ids.
      7 
      8 const breakdown = {
      9  by: "coarseType",
     10  objects: { by: "count", count: true, bytes: true },
     11  scripts: { by: "count", count: true, bytes: true },
     12  strings: { by: "count", count: true, bytes: true },
     13  other: { by: "count", count: true, bytes: true },
     14 };
     15 
     16 add_task(async function () {
     17  const client = new HeapAnalysesClient();
     18 
     19  let threw = false;
     20  try {
     21    await client.getDominatorTree({ dominatorTreeId: 42, breakdown });
     22  } catch (_) {
     23    threw = true;
     24  }
     25  ok(threw, "should throw when given a bad id");
     26 
     27  client.destroy();
     28 });