зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1702061 - [devtools] Remove isPanelReady flag and devtools-panel-ready from DevTools panel instances r=nchevobbe
Depends on D110368 Both the flag and the event are not used. The only thing which matters from the framework perspective is to wait for panel.open to resolve. Differential Revision: https://phabricator.services.mozilla.com/D110369
This commit is contained in:
Родитель
7a570555f5
Коммит
4f9e9360fc
|
@ -131,8 +131,6 @@ AccessibilityPanel.prototype = {
|
|||
shutdown: this.onLifecycleEvent,
|
||||
});
|
||||
|
||||
this.isPanelReady = true;
|
||||
this.emit("devtools-panel-ready");
|
||||
resolver(this);
|
||||
return this._opening;
|
||||
},
|
||||
|
|
|
@ -32,8 +32,6 @@ class ApplicationPanel {
|
|||
panel: this,
|
||||
});
|
||||
|
||||
this.emit("devtools-panel-ready");
|
||||
this.isPanelReady = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,6 @@ class DebuggerPanel {
|
|||
this._store = store;
|
||||
this._selectors = selectors;
|
||||
this._client = client;
|
||||
this.isPanelReady = true;
|
||||
|
||||
this.panelWin.document.addEventListener(
|
||||
"drag:start",
|
||||
|
|
|
@ -49,9 +49,6 @@ DomPanel.prototype = {
|
|||
|
||||
await onGetProperties;
|
||||
|
||||
this.isPanelReady = true;
|
||||
this.emit("devtools-panel-ready");
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ class LazyDevToolsPanel extends DevToolPanel {
|
|||
|
||||
async open() {
|
||||
await wait(TOOL_OPEN_DELAY);
|
||||
this.emit("devtools-panel-ready");
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ async function performChecks(tab) {
|
|||
is(toolbox.currentToolId, toolId, "currentToolId should be " + toolId);
|
||||
|
||||
const panel = toolbox.getCurrentPanel();
|
||||
ok(panel.isPanelReady, toolId + " panel should be ready");
|
||||
ok(panel, toolId + " panel has been registered in the toolbox");
|
||||
}
|
||||
|
||||
await toolbox.destroy();
|
||||
|
|
|
@ -48,7 +48,7 @@ function runTools(tab) {
|
|||
is(toolbox.currentToolId, toolId, "currentToolId should be " + toolId);
|
||||
|
||||
const panel = toolbox.getCurrentPanel();
|
||||
ok(panel.isPanelReady, toolId + " panel should be ready");
|
||||
ok(panel, toolId + " panel has been registered in the toolbox");
|
||||
}
|
||||
|
||||
const client = toolbox.target.client;
|
||||
|
|
|
@ -157,8 +157,6 @@ DevToolPanel.prototype = {
|
|||
open: function() {
|
||||
return new Promise(resolve => {
|
||||
executeSoon(() => {
|
||||
this._isReady = true;
|
||||
this.emit("devtools-panel-ready");
|
||||
resolve(this);
|
||||
});
|
||||
});
|
||||
|
@ -176,12 +174,6 @@ DevToolPanel.prototype = {
|
|||
return this._toolbox;
|
||||
},
|
||||
|
||||
get isPanelReady() {
|
||||
return this._isReady;
|
||||
},
|
||||
|
||||
_isReady: false,
|
||||
|
||||
destroy: function() {
|
||||
return Promise.resolve(null);
|
||||
},
|
||||
|
|
|
@ -73,7 +73,6 @@ function OptionsPanel(iframeWindow, toolbox, commands) {
|
|||
this.toolbox = toolbox;
|
||||
this.commands = commands;
|
||||
this.telemetry = toolbox.telemetry;
|
||||
this.isPanelReady = false;
|
||||
|
||||
this.setupToolsList = this.setupToolsList.bind(this);
|
||||
this._prefChanged = this._prefChanged.bind(this);
|
||||
|
@ -102,8 +101,6 @@ OptionsPanel.prototype = {
|
|||
this.setupThemeList();
|
||||
this.setupAdditionalOptions();
|
||||
await this.populatePreferences();
|
||||
this.isPanelReady = true;
|
||||
this.emit("devtools-panel-ready");
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
@ -149,7 +149,6 @@ function Inspector(toolbox, commands) {
|
|||
this.panelWin.inspector = this;
|
||||
this.telemetry = toolbox.telemetry;
|
||||
this.store = createStore(this);
|
||||
this.isPanelReady = false;
|
||||
|
||||
// Map [panel id => panel instance]
|
||||
// Stores all the instances of sidebar panels like rule view, computed view, ...
|
||||
|
@ -381,7 +380,6 @@ Inspector.prototype = {
|
|||
this.setupSidebar();
|
||||
|
||||
await this._onMarkupViewInitialized;
|
||||
this.isPanelReady = true;
|
||||
|
||||
// All the components are initialized. Take care of the remaining initialization
|
||||
// and setup.
|
||||
|
@ -407,7 +405,6 @@ Inspector.prototype = {
|
|||
1
|
||||
);
|
||||
|
||||
this.emit("devtools-panel-ready");
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ async function testToolboxInitialization(testActor, tab) {
|
|||
|
||||
ok(true, "Inspector started, and notification received.");
|
||||
ok(inspector, "Inspector instance is accessible.");
|
||||
ok(inspector.isPanelReady, "Inspector instance is ready.");
|
||||
is(inspector.currentTarget.localTab, tab, "Valid target.");
|
||||
|
||||
await selectNode("p", inspector);
|
||||
|
|
|
@ -17,7 +17,6 @@ add_task(async function() {
|
|||
async function testToolboxInitialization(tab, inspector, toolbox) {
|
||||
ok(true, "Inspector started, and notification received.");
|
||||
ok(inspector, "Inspector instance is accessible.");
|
||||
ok(inspector.isPanelReady, "Inspector instance is ready.");
|
||||
is(inspector.currentTarget.localTab, tab, "Valid target.");
|
||||
|
||||
await selectNode("#p", inspector);
|
||||
|
|
|
@ -39,9 +39,6 @@ MemoryPanel.prototype = {
|
|||
this._onTargetAvailable
|
||||
);
|
||||
|
||||
this.isPanelReady = true;
|
||||
this.emit("devtools-panel-ready");
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
@ -25,9 +25,6 @@ NetMonitorPanel.prototype = {
|
|||
});
|
||||
|
||||
// Ready to go!
|
||||
this.emit("devtools-panel-ready");
|
||||
this.isPanelReady = true;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
@ -62,8 +62,6 @@ class PerformancePanel {
|
|||
|
||||
const perfFront = await this.target.client.mainRoot.getFront("perf");
|
||||
|
||||
this.isPanelReady = true;
|
||||
this.emit("devtools-panel-ready");
|
||||
this.panelWin.gInit(perfFront, "devtools");
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -60,9 +60,6 @@ PerformancePanel.prototype = {
|
|||
// tab if we need.
|
||||
this._checkRecordingStatus();
|
||||
|
||||
this.isPanelReady = true;
|
||||
this.emit("devtools-panel-ready");
|
||||
|
||||
this._opening = new Promise(resolve => {
|
||||
resolve(this);
|
||||
});
|
||||
|
|
|
@ -31,9 +31,6 @@ class StoragePanel {
|
|||
|
||||
await this.UI.init();
|
||||
|
||||
this.isPanelReady = true;
|
||||
this.emit("devtools-panel-ready");
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,8 +53,6 @@ StyleEditorPanel.prototype = {
|
|||
this.UI.on("error", this._showError);
|
||||
await this.UI.initialize();
|
||||
|
||||
this.isPanelReady = true;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
@ -79,9 +79,6 @@ WebConsolePanel.prototype = {
|
|||
this.hud.ui.on("reloaded", () => {
|
||||
this.emit("reloaded");
|
||||
});
|
||||
|
||||
this._isReady = true;
|
||||
this.emit("devtools-panel-ready");
|
||||
} catch (e) {
|
||||
const msg = "WebConsolePanel open failed. " + e.error + ": " + e.message;
|
||||
dump(msg + "\n");
|
||||
|
@ -95,11 +92,6 @@ WebConsolePanel.prototype = {
|
|||
return this._toolbox.target;
|
||||
},
|
||||
|
||||
_isReady: false,
|
||||
get isPanelReady() {
|
||||
return this._isReady;
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
if (!this._toolbox) {
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче