Bug 1521440: Add test for reloading about:devtools-toolbox. r=jdescottes

Depends on D17795

Differential Revision: https://phabricator.services.mozilla.com/D17796

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Daisuke Akatsuka 2019-01-31 01:39:39 +00:00
parent 0c01c764aa
commit e318e6b1c6
4 changed files with 59 additions and 4 deletions

View File

@ -53,6 +53,7 @@ skip-if = (os == 'linux' && bits == 32) # ADB start() fails on linux 32, see Bug
[browser_aboutdebugging_devtoolstoolbox_contextmenu.js]
[browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js]
[browser_aboutdebugging_devtoolstoolbox_menubar.js]
[browser_aboutdebugging_devtoolstoolbox_reload.js]
[browser_aboutdebugging_devtoolstoolbox_shortcuts.js]
skip-if = (os == "win" && ccov) # Bug 1521349
[browser_aboutdebugging_navigate.js]

View File

@ -62,7 +62,3 @@ function getMarkupViewFrame(rootDocument) {
const inspectorFrame = rootDocument.querySelector("#toolbox-panel-iframe-inspector");
return inspectorFrame.contentDocument.querySelector("#markup-box iframe");
}
function getToolbox(win) {
return gDevTools.getToolboxes().find(toolbox => toolbox.win === win);
}

View File

@ -0,0 +1,54 @@
/* 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 whether about:devtools-toolbox display correctly after reloading.
*/
add_task(async function() {
info("Force all debug target panes to be expanded");
prepareCollapsibilitiesTest();
const { document, tab, window } = await openAboutDebugging();
info("Show about:devtools-toolbox page");
const target = findDebugTargetByText("about:debugging", document);
ok(target, "about:debugging tab target appeared");
const inspectButton = target.querySelector(".js-debug-target-inspect-button");
ok(inspectButton, "Inspect button for about:debugging appeared");
inspectButton.click();
await Promise.all([
waitUntil(() => tab.nextElementSibling),
waitForRequestsToSettle(window.AboutDebugging.store),
gDevTools.once("toolbox-ready"),
]);
info("Wait for about:devtools-toolbox tab will be selected");
const devtoolsTab = tab.nextElementSibling;
await waitUntil(() => gBrowser.selectedTab === devtoolsTab);
info("Select webconsole tool");
const devtoolsBrowser = gBrowser.selectedBrowser;
const toolbox = getToolbox(devtoolsBrowser.contentWindow);
await toolbox.selectTool("webconsole");
info("Reload about:devtools-toolbox page");
devtoolsBrowser.reload();
await gDevTools.once("toolbox-ready");
ok(true, "Toolbox is re-created again");
info("Check whether about:devtools-toolbox page displays correctly");
ok(devtoolsBrowser.contentDocument.querySelector(".debug-target-info"),
"about:devtools-toolbox page displays correctly");
await removeTab(devtoolsTab);
await Promise.all([
waitForRequestsToSettle(window.AboutDebugging.store),
gDevTools.once("toolbox-destroyed"),
]);
await removeTab(tab);
});

View File

@ -218,3 +218,7 @@ async function selectRuntime(deviceName, name, document) {
return runtimeInfo && runtimeInfo.textContent.includes(name);
});
}
function getToolbox(win) {
return gDevTools.getToolboxes().find(toolbox => toolbox.win === win);
}