browser_aboutdebugging_devtools.js (1764B)
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 /** 13 * Check that DevTools are not closed when leaving This Firefox runtime page. 14 */ 15 16 add_task(async function () { 17 info("Force all debug target panes to be expanded"); 18 prepareCollapsibilitiesTest(); 19 20 const { document, tab, window } = await openAboutDebugging(); 21 await selectThisFirefoxPage(document, window.AboutDebugging.store); 22 23 const connectSidebarItem = findSidebarItemByText("Setup", document); 24 const connectLink = connectSidebarItem.querySelector(".qa-sidebar-link"); 25 ok(connectSidebarItem, "Found the Connect sidebar item"); 26 27 info("Open devtools on the current about:debugging tab"); 28 const toolbox = await openToolboxForTab(tab, "inspector"); 29 const inspector = toolbox.getPanel("inspector"); 30 31 info("DevTools starts workers, wait for requests to settle"); 32 const store = window.AboutDebugging.store; 33 await waitForAboutDebuggingRequests(store); 34 35 info("Click on the Connect item in the sidebar"); 36 connectLink.click(); 37 await waitForDispatch(store, "UNWATCH_RUNTIME_SUCCESS"); 38 39 info("Wait until Connect page is displayed"); 40 await waitUntil(() => document.querySelector(".qa-connect-page")); 41 42 const markupViewElement = inspector.panelDoc.getElementById("markup-box"); 43 ok(markupViewElement, "Inspector is still rendered"); 44 45 // We explicitely destroy the toolbox in order to ensure waiting for its full destruction 46 // and avoid leak / pending requests 47 info("Destroy the opened toolbox"); 48 await toolbox.destroy(); 49 50 await removeTab(tab); 51 });