Bug 1365053 - called `_onEyeDropperDone` once the color is selected; r=jdescottes
authorMatteo Ferretti <mferretti@mozilla.com>
Mon, 12 Jun 2017 10:00:05 +0200
changeset 649613 71f4f2c0ec56937235b27ebbc3089af63991d1d0
parent 649541 5ca5691372cb432ec1fa4693ca608a30858226de
child 649614 77117a16d3c37455dec09710661ef493e231a6bc
push id75073
push userbmo:mozilla@hocat.ca
push dateSun, 20 Aug 2017 22:21:51 +0000
reviewersjdescottes
bugs1365053
milestone57.0a1
Bug 1365053 - called `_onEyeDropperDone` once the color is selected; r=jdescottes MozReview-Commit-ID: JUppfvNYmTJ
devtools/client/inspector/rules/test/browser_rules_eyedropper.js
devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js
--- a/devtools/client/inspector/rules/test/browser_rules_eyedropper.js
+++ b/devtools/client/inspector/rules/test/browser_rules_eyedropper.js
@@ -96,16 +96,19 @@ function* testSelect(view, swatch, inspe
                                    options: {type: "mouseup"}});
 
   yield onPicked;
   yield onRuleViewChanged;
 
   let color = swatch.style.backgroundColor;
   is(color, EXPECTED_COLOR, "swatch changed colors");
 
+  ok(!swatch.eyedropperOpen, "swatch eye dropper is closed");
+  ok(!swatch.activeSwatch, "no active swatch");
+
   is((yield getComputedStyleProperty("div", null, "background-color")),
      EXPECTED_COLOR,
      "div's color set to body color after dropper");
 }
 
 function* openEyedropper(view, swatch) {
   let tooltip = view.tooltips.getTooltip("colorPicker").tooltip;
 
--- a/devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js
+++ b/devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js
@@ -171,16 +171,17 @@ SwatchColorPickerTooltip.prototype = Her
       this.hide();
 
       this.tooltip.emit("eyedropper-opened");
     }, e => console.error(e));
 
     inspector.once("color-picked", color => {
       toolbox.win.focus();
       this._selectColor(color);
+      this._onEyeDropperDone();
     });
 
     inspector.once("color-pick-canceled", () => {
       this._onEyeDropperDone();
     });
   },
 
   _onEyeDropperDone: function () {