tor-browser

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

browser_dbg-outline-pretty.js (926B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
      4 
      5 // Tests that the length of outline functions for original and pretty printed source matches
      6 
      7 "use strict";
      8 
      9 add_task(async function () {
     10  const dbg = await initDebugger("doc-scripts.html", "simple1.js");
     11 
     12  await selectSource(dbg, "simple1.js");
     13  await openOutlinePanel(dbg);
     14  const originalSourceOutlineItems = getItems(dbg);
     15 
     16  await togglePrettyPrint(dbg);
     17  await waitForElementWithSelector(dbg, ".outline-list");
     18  const prettySourceOutlineItems = getItems(dbg);
     19 
     20  is(
     21    originalSourceOutlineItems.length,
     22    prettySourceOutlineItems.length,
     23    "Length of outline functions for both prettyPrint and originalSource same"
     24  );
     25 });
     26 
     27 function getItems(dbg) {
     28  return findAllElements(dbg, "outlineItems");
     29 }