Backed out 2 changesets (
bug 1500717,
bug 1500701) for browser-chrome failures at browser/test-oop-extensions/browser_ext_devtools_inspectedWindow.js on a CLOSED TREE
Backed out changeset 4fbd733460be (
bug 1500701)
Backed out changeset 6cd064e0fbd9 (
bug 1500717)
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -3,17 +3,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const SOURCE_MAP_WORKER = "resource://devtools/client/shared/source-map/worker.js";
const SOURCE_MAP_WORKER_ASSETS = "resource://devtools/client/shared/source-map/assets/";
const MAX_ORDINAL = 99;
-const SHOW_ALL_ANONYMOUS_CONTENT_PREF = "devtools.inspector.showAllAnonymousContent";
const SPLITCONSOLE_ENABLED_PREF = "devtools.toolbox.splitconsoleEnabled";
const SPLITCONSOLE_HEIGHT_PREF = "devtools.toolbox.splitconsoleHeight";
const DISABLE_AUTOHIDE_PREF = "ui.popup.disable_autohide";
const HOST_HISTOGRAM = "DEVTOOLS_TOOLBOX_HOST";
const CURRENT_THEME_SCALAR = "devtools.current_theme";
const HTML_NS = "http://www.w3.org/1999/xhtml";
var {Ci, Cc} = require("chrome");
@@ -1684,17 +1683,17 @@ Toolbox.prototype = {
/**
* Ensure the tool with the given id is loaded.
*
* @param {string} id
* The id of the tool to load.
*/
loadTool: function(id) {
if (id === "inspector" && !this._inspector) {
- this.initInspector();
+ return this.initInspector().then(() => this.loadTool(id));
}
let iframe = this.doc.getElementById("toolbox-panel-iframe-" + id);
if (iframe) {
const panel = this._toolPanels.get(id);
return new Promise(resolve => {
if (panel) {
resolve(panel);
@@ -1728,21 +1727,17 @@ Toolbox.prototype = {
// If no parent yet, append the frame into default location.
if (!iframe.parentNode) {
const vbox = this.doc.getElementById("toolbox-panel-" + id);
vbox.appendChild(iframe);
vbox.visibility = "visible";
}
- const onLoad = async () => {
- if (id === "inspector") {
- await this._initInspector;
- }
-
+ const onLoad = () => {
// Prevent flicker while loading by waiting to make visible until now.
iframe.style.visibility = "visible";
// Try to set the dir attribute as early as possible.
this.setIframeDocumentDir(iframe);
// The build method should return a panel instance, so events can
// be fired with the panel as an argument. However, in order to keep
@@ -2674,43 +2669,32 @@ Toolbox.prototype = {
*/
initInspector: function() {
if (!this._initInspector) {
this._initInspector = (async function() {
// Temporary fix for bug #1493131 - inspector has a different life cycle
// than most other fronts because it is closely related to the toolbox.
// TODO: replace with getFront once inspector is separated from the toolbox
this._inspector = this.target.getInspector();
-
- await Promise.all([
- this._getWalker(),
- this._getHighlighter(),
- ]);
-
+ const pref = "devtools.inspector.showAllAnonymousContent";
+ const showAllAnonymousContent = Services.prefs.getBoolPref(pref);
+ this._walker = await this._inspector.getWalker({ showAllAnonymousContent });
this._selection = new Selection(this._walker);
-
this._selection.on("new-node-front", this._onNewSelectedNodeFront);
+
this.walker.on("highlighter-ready", this._highlighterReady);
this.walker.on("highlighter-hide", this._highlighterHidden);
+
+ const autohide = !flags.testing;
+ this._highlighter = await this._inspector.getHighlighter(autohide);
}.bind(this))();
}
return this._initInspector;
},
- _getWalker: async function() {
- const showAllAnonymousContent = Services.prefs.getBoolPref(
- SHOW_ALL_ANONYMOUS_CONTENT_PREF);
- this._walker = await this._inspector.getWalker({ showAllAnonymousContent });
- },
-
- _getHighlighter: async function() {
- const autohide = !flags.testing;
- this._highlighter = await this._inspector.getHighlighter(autohide);
- },
-
_onNewSelectedNodeFront: function() {
// Emit a "selection-changed" event when the toolbox.selection has been set
// to a new node (or cleared). Currently used in the WebExtensions APIs (to
// provide the `devtools.panels.elements.onSelectionChanged` event).
this.emit("selection-changed");
},
_onInspectObject: function(packet) {
--- a/devtools/client/responsive.html/manager.js
+++ b/devtools/client/responsive.html/manager.js
@@ -2,33 +2,33 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Ci } = require("chrome");
const promise = require("promise");
const Services = require("Services");
+const asyncStorage = require("devtools/shared/async-storage");
const EventEmitter = require("devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/debugger-client", true);
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
loader.lazyRequireGetter(this, "throttlingProfiles", "devtools/client/shared/components/throttling/profiles");
loader.lazyRequireGetter(this, "SettingOnboardingTooltip", "devtools/client/responsive.html/setting-onboarding-tooltip");
loader.lazyRequireGetter(this, "swapToInnerBrowser", "devtools/client/responsive.html/browser/swap", true);
loader.lazyRequireGetter(this, "startup", "devtools/client/responsive.html/utils/window", true);
loader.lazyRequireGetter(this, "message", "devtools/client/responsive.html/utils/message");
loader.lazyRequireGetter(this, "showNotification", "devtools/client/responsive.html/utils/notification", true);
loader.lazyRequireGetter(this, "l10n", "devtools/client/responsive.html/utils/l10n");
loader.lazyRequireGetter(this, "EmulationFront", "devtools/shared/fronts/emulation", true);
loader.lazyRequireGetter(this, "PriorityLevels", "devtools/client/shared/components/NotificationBox", true);
loader.lazyRequireGetter(this, "TargetFactory", "devtools/client/framework/target", true);
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
loader.lazyRequireGetter(this, "Telemetry", "devtools/client/shared/telemetry");
-loader.lazyRequireGetter(this, "asyncStorage", "devtools/shared/async-storage");
const TOOL_URL = "chrome://devtools/content/responsive.html/index.xhtml";
const RELOAD_CONDITION_PREF_PREFIX = "devtools.responsive.reloadConditions.";
const RELOAD_NOTIFICATION_PREF = "devtools.responsive.reloadNotification.enabled";
const SHOW_SETTING_TOOLTIP_PREF = "devtools.responsive.show-setting-tooltip";
function debug(msg) {