tor-browser

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

test_DominatorTree_01.js (609B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 "use strict";
      4 
      5 // Sanity test that we can compute dominator trees.
      6 
      7 function run_test() {
      8  const path = ChromeUtils.saveHeapSnapshot({ runtime: true });
      9  const snapshot = ChromeUtils.readHeapSnapshot(path);
     10 
     11  const dominatorTree = snapshot.computeDominatorTree();
     12  ok(dominatorTree);
     13  ok(DominatorTree.isInstance(dominatorTree));
     14 
     15  let threw = false;
     16  try {
     17    new DominatorTree();
     18  } catch (e) {
     19    threw = true;
     20  }
     21  ok(threw, "Constructor shouldn't be usable");
     22 
     23  do_test_finished();
     24 }