Bug 1508656 - fix failing test browser_inspector_switch-to-inspector-on-pick; r=ochameau
authoryulia <ystartsev@mozilla.com>
Tue, 18 Dec 2018 08:44:58 +0000
changeset 452255 c96ac5e8720947da75c302fa91d45ddfc7dce92a
parent 452254 fbf96ce2270ba895f2a331105648d00340589f10
child 452256 2ae23429e483c06fe3d50f9fcf9fcae579fbdbce
push id35299
push userbtara@mozilla.com
push dateWed, 02 Jan 2019 21:34:59 +0000
treeherdermozilla-central@7e75579b27d0 [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.
    */