summaryrefslogtreecommitdiffstats
path: root/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js
blob: 50857ee617ff0ebf6d53b670815dd8b7fd886cc7 (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
/* 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 preference of DebugTargetPane collapsibilities.
 */

add_task(async function () {
  prepareCollapsibilitiesTest();

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

  info("Collapse all pane");
  for (const { title } of TARGET_PANES) {
    const debugTargetPaneEl = getDebugTargetPane(title, document);
    await toggleCollapsibility(debugTargetPaneEl);
  }

  info("Check preference of collapsibility after closing about:debugging page");
  await removeTab(tab);
  // Wait until unmount.
  await waitUntil(() => document.querySelector(".app") === null);

  for (const { pref } of TARGET_PANES) {
    is(
      Services.prefs.getBoolPref(pref),
      true,
      `${pref} preference should be true`
    );
  }
});