Bug 1538731 - Add test for panel reloading with about:devtools-toolbox;r=daisuke

Depends on D26899
This test would timeout with the fix in the previous patch

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2019-04-11 14:50:04 +00:00
Родитель 375ef75753
Коммит 2416e24e10
3 изменённых файлов: 32 добавлений и 3 удалений

Просмотреть файл

@ -58,6 +58,7 @@ skip-if = (os == 'linux' && bits == 32) # ADB start() fails on linux 32, see Bug
[browser_aboutdebugging_devtoolstoolbox_focus.js]
[browser_aboutdebugging_devtoolstoolbox_menubar.js]
[browser_aboutdebugging_devtoolstoolbox_reload.js]
skip-if = verify # test loads the toolbox 2 times for each panel, might timeout or OOM
[browser_aboutdebugging_devtoolstoolbox_shortcuts.js]
skip-if = (os == "win" && ccov) # Bug 1521349
[browser_aboutdebugging_devtoolstoolbox_target_destroyed.js]

Просмотреть файл

@ -3,9 +3,24 @@
"use strict";
// Test can run for a long time on debug platforms.
requestLongerTimeout(5);
/* import-globals-from helper-collapsibilities.js */
Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-collapsibilities.js", this);
const TOOLS = [
"inspector",
"webconsole",
"jsdebugger",
"styleeditor",
"performance",
"memory",
"netmonitor",
"storage",
"accessibility",
];
/**
* Test whether about:devtools-toolbox display correctly after reloading.
*/
@ -13,14 +28,20 @@ add_task(async function() {
info("Force all debug target panes to be expanded");
prepareCollapsibilitiesTest();
for (const toolId of TOOLS) {
await testReloadAboutDevToolsToolbox(toolId);
}
});
async function testReloadAboutDevToolsToolbox(toolId) {
const { document, tab, window } = await openAboutDebugging();
await selectThisFirefoxPage(document, window.AboutDebugging.store);
const { devtoolsBrowser, devtoolsTab, devtoolsWindow } =
await openAboutDevtoolsToolbox(document, tab, window);
info("Select webconsole tool");
info(`Select tool: ${toolId}`);
const toolbox = getToolbox(devtoolsWindow);
await toolbox.selectTool("webconsole");
await toolbox.selectTool(toolId);
info("Reload about:devtools-toolbox page");
devtoolsBrowser.reload();
@ -33,4 +54,4 @@ add_task(async function() {
await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
await removeTab(tab);
});
}

Просмотреть файл

@ -99,13 +99,20 @@ async function openAboutDevtoolsToolbox(doc, tab, win, targetText = "about:debug
async function closeAboutDevtoolsToolbox(aboutDebuggingDocument, devtoolsTab, win) {
info("Close about:devtools-toolbox page");
const onToolboxDestroyed = gDevTools.once("toolbox-destroyed");
info("Wait for removeTab");
await removeTab(devtoolsTab);
info("Wait for toolbox destroyed");
await onToolboxDestroyed;
// Changing the tab will also trigger a request to list tabs, so wait until the selected
// tab has changed to wait for requests to settle.
info("Wait until aboutdebugging is selected");
await waitUntil(() => gBrowser.selectedTab !== devtoolsTab);
// Wait for removing about:devtools-toolbox tab info from about:debugging.
info("Wait until about:devtools-toolbox is removed from debug targets");
await waitUntil(() =>
!findDebugTargetByText("about:devtools-toolbox?", aboutDebuggingDocument));