summaryrefslogtreecommitdiffstats
path: root/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main_local.js
blob: 06bd29095ccee18bc9e1b44d13765d70f1811473 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

/* import-globals-from helper-collapsibilities.js */
Services.scriptloader.loadSubScript(
  CHROME_URL_ROOT + "helper-collapsibilities.js",
  this
);

// Test for main process against This Firefox.
//
// The main added value for this test is to check that listing processes
// and opening a toolbox targeting a process works, even though debugging
// the main process of This Firefox is not really supported.
add_task(async function () {
  await pushPref("devtools.aboutdebugging.process-debugging", true);
  await pushPref("devtools.aboutdebugging.test-local-process-debugging", true);

  const { document, tab, window } = await openAboutDebugging();
  await selectThisFirefoxPage(document, window.AboutDebugging.store);

  info("Check debug target item of the main process");
  const mainProcessItem = findDebugTargetByText("Multiprocess", document);
  ok(mainProcessItem, "Debug target item of the main process should display");
  ok(
    mainProcessItem.textContent.includes(
      "Main Process and Content Processes for the target browser"
    ),
    "Debug target item of the main process should contains the description"
  );

  info("Inspect main process and wait for DevTools to open");
  const { devtoolsTab } = await openAboutDevtoolsToolbox(
    document,
    tab,
    window,
    "Main Process"
  );

  await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
  await removeTab(tab);
});