Backed out changeset 3c11553b2e79 (bug 1702078) for damp failure in accessibility/cold-open.js. CLOSED TREE

This commit is contained in:
Sebastian Hengst 2021-04-07 21:49:32 +02:00
Родитель 2dcbcaf940
Коммит edde618936
6 изменённых файлов: 27 добавлений и 47 удалений

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

@ -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,10 @@ 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;
this.accessibilityProxy = new AccessibilityProxy(this._commands);
this.accessibilityProxy.startListeningForTargetUpdated(
@ -127,12 +131,6 @@ AccessibilityPanel.prototype = {
shutdown: this.onLifecycleEvent,
});
// Force refresh to render the UI and wait for the INITIALIZED event.
const onInitialized = this.panelWin.once(EVENTS.INITIALIZED);
this.shouldRefresh = true;
this.refresh();
await onInitialized;
resolver(this);
return this._opening;
},

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

@ -42,16 +42,7 @@ const tests = [
keyboardShortcut: "",
childCount: 2,
indexInParent: 0,
states: [
// The focused state is an outdated state, since the toolbox should now
// have the focus and not the content page. See Bug 1702709.
"focused",
"readonly",
"focusable",
"opaque",
"enabled",
"sensitive",
],
states: ["readonly", "focusable", "opaque", "enabled", "sensitive"],
},
},
},

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

@ -33,16 +33,7 @@ const tests = [
keyboardShortcut: "",
childCount: 0,
indexInParent: 0,
states: [
// The focused state is an outdated state, since the toolbox should now
// have the focus and not the content page. See Bug 1702709.
"focused",
"readonly",
"focusable",
"opaque",
"enabled",
"sensitive",
],
states: ["readonly", "focusable", "opaque", "enabled", "sensitive"],
},
},
},

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

@ -42,16 +42,7 @@ const tests = [
keyboardShortcut: "",
childCount: 2,
indexInParent: 0,
states: [
// The focused state is an outdated state, since the toolbox should now
// have the focus and not the content page. See Bug 1702709.
"focused",
"readonly",
"focusable",
"opaque",
"enabled",
"sensitive",
],
states: ["readonly", "focusable", "opaque", "enabled", "sensitive"],
},
},
},

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

@ -34,16 +34,7 @@ const tests = [
keyboardShortcut: "",
childCount: 1,
indexInParent: 0,
states: [
// The focused state is an outdated state, since the toolbox should now
// have the focus and not the content page. See Bug 1702709.
"focused",
"readonly",
"focusable",
"opaque",
"enabled",
"sensitive",
],
states: ["readonly", "focusable", "opaque", "enabled", "sensitive"],
},
},
},