Bug 1508656 - fix failing test browser_inspector_switch-to-inspector-on-pick; r=ochameau
☠☠ backed out by fbe9f6e140ae ☠ ☠
authoryulia <ystartsev@mozilla.com>
Mon, 17 Dec 2018 12:29:30 +0000
changeset 450943 caafdc0ea4c7ca4fd0e7b2c053c89472fae5219b
parent 450942 8b98b777aec23f2a5b5900bdd57e3bef1016abf0
child 450944 140374b098aa9d6c4f40a0bb56f60783b736f245
push id74818
push userystartsev@mozilla.com
push dateMon, 17 Dec 2018 13:25:30 +0000
treeherderautoland@01b687bb0b75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1508656
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508656 - fix failing test browser_inspector_switch-to-inspector-on-pick; r=ochameau Depends on D12290 Differential Revision: https://phabricator.services.mozilla.com/D12291
devtools/client/framework/toolbox.js
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -1267,24 +1267,27 @@ Toolbox.prototype = {
    * Toggle the picker, but also decide whether or not the highlighter should
    * focus the window. This is only desirable when the toolbox is mounted to the
    * window. When devtools is free floating, then the target window should not
    * pop in front of the viewer when the picker is clicked.
    *
    * Note: Toggle picker can be overwritten by panel other than the inspector to
    * allow for custom picker behaviour.
    */
-  _onPickerClick: function() {
+  _onPickerClick: async function() {
     const focus = this.hostType === Toolbox.HostType.BOTTOM ||
                   this.hostType === Toolbox.HostType.LEFT ||
                   this.hostType === Toolbox.HostType.RIGHT;
     const currentPanel = this.getCurrentPanel();
     if (currentPanel.togglePicker) {
       currentPanel.togglePicker(focus);
     } else {
+      if (!this.inspector) {
+        await this.initInspector();
+      }
       this.inspector.nodePicker.togglePicker(focus);
     }
   },
 
   /**
    * If the picker is activated, then allow the Escape key to deactivate the
    * functionality instead of the default behavior of toggling the console.
    */