Bug 1496572 - Fix intermittent devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-xul.js by adding a new emitted event for the inspector toolbar update. r=pbro
authorGabriel Luong <gabriel.luong@gmail.com>
Sat, 13 Oct 2018 06:53:00 +0300
changeset 499638 4afcdb551984b452e41847bc2a2690f46bdbbefe
parent 499637 ec067b17f7d32f9080ed97d8a51414d0a37acf8a
child 499639 6213dd2a20f2c544722ff18d62863cbf6e031b8e
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1496572
milestone64.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 1496572 - Fix intermittent devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-xul.js by adding a new emitted event for the inspector toolbar update. r=pbro
devtools/client/inspector/inspector.js
devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-xul.js
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -1124,16 +1124,18 @@ Inspector.prototype = {
       this.eyeDropperButton.title = INSPECTOR_L10N.getStr("inspector.eyedropper.label");
       this.eyeDropperButton.addEventListener("click", this.onEyeDropperButtonClicked);
     } else {
       const eyeDropperButton =
         this.panelDoc.getElementById("inspector-eyedropper-toggle");
       eyeDropperButton.disabled = true;
       eyeDropperButton.title = INSPECTOR_L10N.getStr("eyedropper.disabled.title");
     }
+
+    this.emit("inspector-toolbar-updated");
   },
 
   teardownToolbar: function() {
     if (this.addNodeButton) {
       this.addNodeButton.removeEventListener("click", this.addNode);
       this.addNodeButton = null;
     }
 
--- a/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-xul.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-xul.js
@@ -30,17 +30,19 @@ add_task(async function() {
   let onColorPickerReady = cPicker.once("ready");
   swatchEl.click();
   await onColorPickerReady;
 
   button = cPicker.tooltip.container.querySelector("#eyedropper-button");
   ok(isDisabled(button), "The button is disabled in the color picker");
 
   info("Navigate to a HTML document");
+  const toolbarUpdated = inspector.once("inspector-toolbar-updated");
   await navigateTo(inspector, TEST_URL_2);
+  await toolbarUpdated;
 
   info("Check the inspector toolbar in HTML document");
   button = inspector.panelDoc.querySelector("#inspector-eyedropper-toggle");
   ok(!isDisabled(button), "The button is enabled in the toolbar");
 
   info("Check the color picker in HTML document");
   // Find the color swatch in the rule-view.
   await selectNode("h1", inspector);