summaryrefslogtreecommitdiffstats
path: root/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js')
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js
new file mode 100644
index 0000000000..4ea3238ea3
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js
@@ -0,0 +1,51 @@
+/* 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
+);
+
+/**
+ * Check that DevTools are not closed when leaving This Firefox runtime page.
+ */
+
+add_task(async function () {
+ info("Force all debug target panes to be expanded");
+ prepareCollapsibilitiesTest();
+
+ const { document, tab, window } = await openAboutDebugging();
+ await selectThisFirefoxPage(document, window.AboutDebugging.store);
+
+ const connectSidebarItem = findSidebarItemByText("Setup", document);
+ const connectLink = connectSidebarItem.querySelector(".qa-sidebar-link");
+ ok(connectSidebarItem, "Found the Connect sidebar item");
+
+ info("Open devtools on the current about:debugging tab");
+ const toolbox = await openToolboxForTab(tab, "inspector");
+ const inspector = toolbox.getPanel("inspector");
+
+ info("DevTools starts workers, wait for requests to settle");
+ const store = window.AboutDebugging.store;
+ await waitForAboutDebuggingRequests(store);
+
+ info("Click on the Connect item in the sidebar");
+ connectLink.click();
+ await waitForDispatch(store, "UNWATCH_RUNTIME_SUCCESS");
+
+ info("Wait until Connect page is displayed");
+ await waitUntil(() => document.querySelector(".qa-connect-page"));
+
+ const markupViewElement = inspector.panelDoc.getElementById("markup-box");
+ ok(markupViewElement, "Inspector is still rendered");
+
+ // We explicitely destroy the toolbox in order to ensure waiting for its full destruction
+ // and avoid leak / pending requests
+ info("Destroy the opened toolbox");
+ await toolbox.destroy();
+
+ await removeTab(tab);
+});