Bug 1508656 - migrate picker-node-hovered to nodePicker; r=ochameau
authoryulia <ystartsev@mozilla.com>
Tue, 18 Dec 2018 08:42:10 +0000
changeset 509357 fbf96ce2270ba895f2a331105648d00340589f10
parent 509356 d78f0458b4d92593467b0e0060b63818d07ab94c
child 509358 c96ac5e8720947da75c302fa91d45ddfc7dce92a
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [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 - migrate picker-node-hovered to nodePicker; r=ochameau Depends on D12290 Differential Revision: https://phabricator.services.mozilla.com/D12738
devtools/client/inspector/markup/markup.js
devtools/client/inspector/test/browser_inspector_highlighter-03.js
devtools/client/inspector/test/browser_inspector_highlighter-iframes_01.js
devtools/client/inspector/test/browser_inspector_highlighter-keybinding_01.js
devtools/client/inspector/test/browser_inspector_highlighter-keybinding_02.js
devtools/client/inspector/test/browser_inspector_highlighter-keybinding_03.js
devtools/client/inspector/test/browser_inspector_highlighter-keybinding_04.js
devtools/client/inspector/test/browser_inspector_highlighter-xbl.js
devtools/client/inspector/test/head.js
--- a/devtools/client/inspector/markup/markup.js
+++ b/devtools/client/inspector/markup/markup.js
@@ -119,17 +119,19 @@ function MarkupView(inspector, frame, co
   this.inspector.selection.on("new-node-front", this._onNewSelection);
   this.walker.on("display-change", this._onDisplayChange);
   this.walker.on("mutations", this._mutationObserver);
   this.win.addEventListener("copy", this._onCopy);
   this.win.addEventListener("mouseup", this._onMouseUp);
   this.inspector.inspector.nodePicker.on(
     "picker-node-canceled", this._onToolboxPickerCanceled
   );
-  this.toolbox.on("picker-node-hovered", this._onToolboxPickerHover);
+  this.inspector.inspector.nodePicker.on(
+    "picker-node-hovered", this._onToolboxPickerHover
+  );
 
   if (flags.testing) {
     // In tests, we start listening immediately to avoid having to simulate a mousemove.
     this._initTooltips();
   } else {
     this._elt.addEventListener("mousemove", () => {
       this._initTooltips();
     }, { once: true });
@@ -1946,17 +1948,19 @@ MarkupView.prototype = {
     this.popup = null;
 
     this._elt.removeEventListener("blur", this._onBlur, true);
     this._elt.removeEventListener("click", this._onMouseClick);
     this._elt.removeEventListener("mousemove", this._onMouseMove);
     this._elt.removeEventListener("mouseout", this._onMouseOut);
     this._frame.removeEventListener("focus", this._onFocus);
     this.inspector.selection.off("new-node-front", this._onNewSelection);
-    this.toolbox.off("picker-node-hovered", this._onToolboxPickerHover);
+    this.inspector.inspector.nodePicker.off(
+      "picker-node-hovered", this._onToolboxPickerHover
+    );
     this.walker.off("display-change", this._onDisplayChange);
     this.walker.off("mutations", this._mutationObserver);
     this.win.removeEventListener("copy", this._onCopy);
     this.win.removeEventListener("mouseup", this._onMouseUp);
 
     this._prefObserver.off(ATTR_COLLAPSE_ENABLED_PREF,
                            this._onCollapseAttributesPrefChange);
     this._prefObserver.off(ATTR_COLLAPSE_LENGTH_PREF,
--- a/devtools/client/inspector/test/browser_inspector_highlighter-03.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-03.js
@@ -60,11 +60,11 @@ add_task(async function() {
   await testActor.isNodeCorrectlyHighlighted(iframeBodySelector, is);
 
   info("Waiting for the element picker to deactivate.");
   await inspector.inspector.nodePicker.stop();
 
   function moveMouseOver(selector, x, y) {
     info("Waiting for element " + selector + " to be highlighted");
     testActor.synthesizeMouse({selector, x, y, options: {type: "mousemove"}});
-    return inspector.toolbox.once("picker-node-hovered");
+    return inspector.inspector.nodePicker.once("picker-node-hovered");
   }
 });
--- a/devtools/client/inspector/test/browser_inspector_highlighter-iframes_01.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-iframes_01.js
@@ -54,11 +54,11 @@ add_task(async function() {
   await inspector.inspector.nodePicker.stop();
 
   function moveMouseOver(selector) {
     info("Waiting for element " + selector + " to be highlighted");
     testActor.synthesizeMouse({
       selector: selector,
       options: {type: "mousemove"},
       center: true,
-    }).then(() => inspector.toolbox.once("picker-node-hovered"));
+    }).then(() => inspector.inspector.nodePicker.once("picker-node-hovered"));
   }
 });
--- a/devtools/client/inspector/test/browser_inspector_highlighter-keybinding_01.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-keybinding_01.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 // Test that the keybindings for Picker work alright
 
 const TEST_URL = URL_ROOT + "doc_inspector_highlighter_dom.html";
 
 add_task(async function() {
-  const {inspector, toolbox, testActor} = await openInspectorForURL(TEST_URL);
+  const {toolbox, testActor} = await openInspectorForURL(TEST_URL);
 
   await startPicker(toolbox);
 
   info("Selecting the simple-div1 DIV");
   await moveMouseOver("#simple-div1");
 
   ok((await testActor.assertHighlightedNode("#simple-div1")),
      "The highlighter shows #simple-div1. OK.");
@@ -44,21 +44,21 @@ add_task(async function() {
   info("First child selection test Passed.");
 
   info("Stopping the picker");
   await toolbox.inspector.nodePicker.stop();
 
   function doKeyHover(args) {
     info("Key pressed. Waiting for element to be highlighted/hovered");
     testActor.synthesizeKey(args);
-    return inspector.toolbox.once("picker-node-hovered");
+    return toolbox.inspector.nodePicker.once("picker-node-hovered");
   }
 
   function moveMouseOver(selector) {
     info("Waiting for element " + selector + " to be highlighted");
     testActor.synthesizeMouse({
       options: {type: "mousemove"},
       center: true,
       selector: selector,
     });
-    return inspector.toolbox.once("picker-node-hovered");
+    return toolbox.inspector.nodePicker.once("picker-node-hovered");
   }
 });
--- a/devtools/client/inspector/test/browser_inspector_highlighter-keybinding_02.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-keybinding_02.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 // Test that the keybindings for Picker work alright
 
 const TEST_URL = URL_ROOT + "doc_inspector_highlighter_dom.html";
 
 add_task(async function() {
-  const {inspector, toolbox, testActor} = await openInspectorForURL(TEST_URL);
+  const {toolbox, testActor} = await openInspectorForURL(TEST_URL);
 
   await startPicker(toolbox);
 
   // Previously chosen child memory
   info("Testing whether previously chosen child is remembered");
 
   info("Selecting the ahoy paragraph DIV");
   await moveMouseOver("#ahoy");
@@ -40,25 +40,25 @@ add_task(async function() {
   info("Previously chosen child is remembered. Passed.");
 
   info("Stopping the picker");
   await toolbox.inspector.nodePicker.stop();
 
   function doKeyHover(args) {
     info("Key pressed. Waiting for element to be highlighted/hovered");
     const onHighlighterReady = toolbox.once("highlighter-ready");
-    const onPickerNodeHovered = inspector.toolbox.once("picker-node-hovered");
+    const onPickerNodeHovered = toolbox.inspector.nodePicker.once("picker-node-hovered");
     testActor.synthesizeKey(args);
     return promise.all([onHighlighterReady, onPickerNodeHovered]);
   }
 
   function moveMouseOver(selector) {
     info("Waiting for element " + selector + " to be highlighted");
     const onHighlighterReady = toolbox.once("highlighter-ready");
-    const onPickerNodeHovered = inspector.toolbox.once("picker-node-hovered");
+    const onPickerNodeHovered = toolbox.inspector.nodePicker.once("picker-node-hovered");
     testActor.synthesizeMouse({
       options: {type: "mousemove"},
       center: true,
       selector: selector,
     });
     return promise.all([onHighlighterReady, onPickerNodeHovered]);
   }
 });
--- a/devtools/client/inspector/test/browser_inspector_highlighter-keybinding_03.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-keybinding_03.js
@@ -56,17 +56,18 @@ add_task(async function() {
     info("Key pressed. Waiting for picker to be canceled");
     testActor.synthesizeKey(args);
     return inspector.inspector.nodePicker.once("picker-stopped");
   }
 
   function moveMouseOver(selector) {
     info("Waiting for element " + selector + " to be highlighted");
     const onHighlighterReady = toolbox.once("highlighter-ready");
-    const onPickerNodeHovered = inspector.toolbox.once("picker-node-hovered");
+    const onPickerNodeHovered =
+      inspector.inspector.nodePicker.once("picker-node-hovered");
     testActor.synthesizeMouse({
       options: {type: "mousemove"},
       center: true,
       selector: selector,
     });
     return promise.all([onHighlighterReady, onPickerNodeHovered]);
   }
 });
--- a/devtools/client/inspector/test/browser_inspector_highlighter-keybinding_04.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-keybinding_04.js
@@ -10,17 +10,17 @@
 const TEST_URL = "data:text/html;charset=utf8,<div></div>";
 
 add_task(async function() {
   const {inspector, toolbox, testActor} = await openInspectorForURL(TEST_URL);
 
   await startPicker(toolbox);
 
   info("Start using the picker by hovering over nodes");
-  const onHover = toolbox.once("picker-node-hovered");
+  const onHover = toolbox.inspector.nodePicker.once("picker-node-hovered");
   testActor.synthesizeMouse({
     options: {type: "mousemove"},
     center: true,
     selector: "div",
   });
   await onHover;
 
   info("Press escape and wait for the picker to stop");
--- a/devtools/client/inspector/test/browser_inspector_highlighter-xbl.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-xbl.js
@@ -29,11 +29,11 @@ add_task(async function() {
 
   function moveMouseOver(selector) {
     info("Waiting for element " + selector + " to be highlighted");
     testActor.synthesizeMouse({
       options: {type: "mousemove"},
       center: true,
       selector: selector,
     });
-    return inspector.toolbox.once("picker-node-hovered");
+    return inspector.inspector.nodePicker.once("picker-node-hovered");
   }
 });
--- a/devtools/client/inspector/test/head.js
+++ b/devtools/client/inspector/test/head.js
@@ -116,17 +116,17 @@ function pickElement(inspector, testActo
  *        X-offset from the top-left corner of the element matching the provided selector
  * @param {Number} y
  *        Y-offset from the top-left corner of the element matching the provided selector
  * @return {Promise} promise that resolves when the "picker-node-hovered" event is
  *         emitted.
  */
 function hoverElement(inspector, testActor, selector, x, y) {
   info("Waiting for element " + selector + " to be hovered");
-  const onHovered = inspector.toolbox.once("picker-node-hovered");
+  const onHovered = inspector.inspector.nodePicker.once("picker-node-hovered");
   testActor.synthesizeMouse({selector, x, y, options: {type: "mousemove"}});
   return onHovered;
 }
 
 /**
  * Highlight a node and set the inspector's current selection to the node or
  * the first match of the given css selector.
  * @param {String|NodeFront} selector