зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1699619 - [devtools] Wait for a11y panel initialization in browser_aboutdebugging_devtoolstoolbox_reload r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D110345
This commit is contained in:
Родитель
9408355c3c
Коммит
1e32445f35
|
@ -61,12 +61,25 @@ async function testReloadAboutDevToolsToolbox(toolId) {
|
|||
const toolbox = getToolbox(devtoolsWindow);
|
||||
await toolbox.selectTool(toolId);
|
||||
|
||||
// The a11y panel finishes its initialization after selectTool resolves.
|
||||
// TODO: The a11y panel init should only resolve when the UI is ready and all
|
||||
// initial requests are completed. See Bug 1702078.
|
||||
if (toolId === "accessibility") {
|
||||
await waitForA11yPanel(toolbox);
|
||||
}
|
||||
|
||||
info("Wait for requests to settle before reloading");
|
||||
await toolbox.target.client.waitForRequestsToSettle();
|
||||
|
||||
info("Reload about:devtools-toolbox page");
|
||||
devtoolsBrowser.reload();
|
||||
await gDevTools.once("toolbox-ready");
|
||||
const newToolbox = await gDevTools.once("toolbox-ready");
|
||||
|
||||
// Again, wait for the delayed a11y panel initialization.
|
||||
if (toolId === "accessibility") {
|
||||
await waitForA11yPanel(newToolbox);
|
||||
}
|
||||
|
||||
ok(true, "Toolbox is re-created again");
|
||||
|
||||
// Check that about:devtools-toolbox is still selected tab. See Bug 1570692.
|
||||
|
@ -85,3 +98,8 @@ async function testReloadAboutDevToolsToolbox(toolId) {
|
|||
await closeAboutDevtoolsToolbox(document, devtoolsTab, window);
|
||||
await removeTab(tab);
|
||||
}
|
||||
|
||||
async function waitForA11yPanel(toolbox) {
|
||||
const panel = toolbox.getPanel("accessibility");
|
||||
await panel._accessibilityViewInitialized;
|
||||
}
|
||||
|
|
|
@ -103,6 +103,8 @@ AccessibilityPanel.prototype = {
|
|||
EVENTS.ACCESSIBILITY_INSPECTOR_UPDATED,
|
||||
this.onAccessibilityInspectorUpdated
|
||||
);
|
||||
// Expose a promise so that tests can wait for the UI to be ready.
|
||||
this._accessibilityViewInitialized = this.panelWin.once(EVENTS.INITIALIZED);
|
||||
|
||||
this.shouldRefresh = true;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче