tor-browser

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

browser_aboutdebugging_process_main_local.js (1533B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 /* import-globals-from helper-collapsibilities.js */
      7 Services.scriptloader.loadSubScript(
      8  CHROME_URL_ROOT + "helper-collapsibilities.js",
      9  this
     10 );
     11 
     12 // Test for main process against This Firefox.
     13 //
     14 // The main added value for this test is to check that listing processes
     15 // and opening a toolbox targeting a process works, even though debugging
     16 // the main process of This Firefox is not really supported.
     17 add_task(async function () {
     18  await pushPref("devtools.aboutdebugging.process-debugging", true);
     19  await pushPref("devtools.aboutdebugging.test-local-process-debugging", true);
     20 
     21  const { document, tab, window } = await openAboutDebugging();
     22  await selectThisFirefoxPage(document, window.AboutDebugging.store);
     23 
     24  info("Check debug target item of the main process");
     25  const mainProcessItem = findDebugTargetByText("Multiprocess", document);
     26  ok(mainProcessItem, "Debug target item of the main process should display");
     27  ok(
     28    mainProcessItem.textContent.includes(
     29      "Main Process and Content Processes for the target browser"
     30    ),
     31    "Debug target item of the main process should contains the description"
     32  );
     33 
     34  info("Inspect main process and wait for DevTools to open");
     35  const { devtoolsTab } = await openAboutDevtoolsToolbox(
     36    document,
     37    tab,
     38    window,
     39    "Main Process"
     40  );
     41 
     42  await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
     43  await removeTab(tab);
     44 });