summaryrefslogtreecommitdiffstats
path: root/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_target_destroyed.js
blob: d0001d1c0370b4ef2f923e5429f9e5ca87ea9b0e (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
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

// Test that the expected supported categories are displayed for USB runtimes.
add_task(async function () {
  const targetTab = await addTab("about:home");

  const { document, tab, window } = await openAboutDebugging();

  // go to This Firefox and inspect the new tab
  info("Inspecting a new tab in This Firefox");
  await selectThisFirefoxPage(document, window.AboutDebugging.store);
  const { devtoolsDocument, devtoolsTab, devtoolsWindow } =
    await openAboutDevtoolsToolbox(document, tab, window, "about:home");
  const targetUrl = devtoolsDocument.querySelector(".devtools-textinput");
  ok(
    targetUrl.value.includes("about:home"),
    "about:devtools-toolbox is open for the target"
  );

  // close the inspected tab and check that error page is shown
  info("removing the inspected tab");
  await removeTab(targetTab);
  await waitUntil(() =>
    devtoolsWindow.document.querySelector(".qa-error-page")
  );

  info("closing the toolbox");
  await removeTab(devtoolsTab);
  await waitUntil(() => !findDebugTargetByText("Toolbox -", document));

  info("removing about:debugging tab");
  await removeTab(tab);
});