Bug 1093431 - Intermittent browser_styleinspector_tooltip-closes-on-new-selection.js. r+a=test-only
authorPatrick Brosset <pbrosset@mozilla.com>
Mon, 17 Aug 2015 13:58:56 +0200
changeset 288780 89bc7fc0d12eb2381a5197f4e67501176b88191b
parent 288779 49d5f5eb473a60adfc227080bec78e946bdf7cd2
child 288781 d4cbcd9fff58d07dfc454d28cb56f0601ba22031
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1093431
milestone42.0a2
Bug 1093431 - Intermittent browser_styleinspector_tooltip-closes-on-new-selection.js. r+a=test-only Make sure the test removes the toggling on hover of the rule-view tooltip to avoid intermittents when mouseleave events are somehow simulated in previous tests. And cleanup the test a little bit so it actually tests something.
browser/devtools/styleinspector/test/browser_styleinspector_tooltip-closes-on-new-selection.js
--- a/browser/devtools/styleinspector/test/browser_styleinspector_tooltip-closes-on-new-selection.js
+++ b/browser/devtools/styleinspector/test/browser_styleinspector_tooltip-closes-on-new-selection.js
@@ -17,33 +17,49 @@ add_task(function*() {
 
   info("Testing computed view tooltip closes on new selection");
   ({view} = yield openComputedView());
   yield testComputedView(view, inspector);
 });
 
 function* testRuleView(ruleView, inspector) {
   info("Showing the tooltip");
+
   let tooltip = ruleView.tooltips.previewTooltip;
+  tooltip.setTextContent({messages: ["rule-view tooltip"]});
+  // Stop listening for mouse movements because it's not needed for this test,
+  // and causes intermittent failures on Linux. When this test runs in the suite
+  // sometimes a mouseleave event is dispatched at the start, which causes the
+  // tooltip to hide in the middle of being shown, which causes timeouts later.
+  tooltip.stopTogglingOnHover();
+
   let onShown = tooltip.once("shown");
-  tooltip.show();
+  tooltip.show(ruleView.styleDocument.firstElementChild);
   yield onShown;
 
   info("Selecting a new node");
   let onHidden = tooltip.once("hidden");
   yield selectNode(".two", inspector);
 
   ok(true, "Rule view tooltip closed after a new node got selected");
 }
 
 function* testComputedView(computedView, inspector) {
   info("Showing the tooltip");
+
   let tooltip = computedView.tooltips.previewTooltip;
+  tooltip.setTextContent({messages: ["computed-view tooltip"]});
+  // Stop listening for mouse movements because it's not needed for this test,
+  // and causes intermittent failures on Linux. When this test runs in the suite
+  // sometimes a mouseleave event is dispatched at the start, which causes the
+  // tooltip to hide in the middle of being shown, which causes timeouts later.
+  tooltip.stopTogglingOnHover();
+
   let onShown = tooltip.once("shown");
-  tooltip.show();
+  tooltip.show(computedView.styleDocument.firstElementChild);
   yield onShown;
 
   info("Selecting a new node");
   let onHidden = tooltip.once("hidden");
   yield selectNode(".one", inspector);
 
   ok(true, "Computed view tooltip closed after a new node got selected");
 }