Bug 1093431 - Intermittent browser_styleinspector_tooltip-closes-on-new-selection.js; r=test-only
authorPatrick Brosset <pbrosset@mozilla.com>
Mon, 17 Aug 2015 13:58:56 +0200
changeset 258174 d9483f8ae185d9b01a8248ff8fbbf9a94eb15bd9
parent 258173 0d81c8f063dddeea0fff9da0b30ed432884d3a41
child 258175 0ec4b789a1737f923cab976cf87a2dab697d8d0a
push id63843
push userryanvm@gmail.com
push dateTue, 18 Aug 2015 14:58:06 +0000
treeherdermozilla-inbound@d55e24c983aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs1093431
milestone43.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 1093431 - Intermittent browser_styleinspector_tooltip-closes-on-new-selection.js; r=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.ini
browser/devtools/styleinspector/test/browser_styleinspector_tooltip-closes-on-new-selection.js
--- a/browser/devtools/styleinspector/test/browser.ini
+++ b/browser/devtools/styleinspector/test/browser.ini
@@ -188,17 +188,17 @@ skip-if = e10s # bug 1040670 Cannot open
 [browser_styleinspector_context-menu-copy-color_01.js]
 [browser_styleinspector_context-menu-copy-color_02.js]
 [browser_styleinspector_context-menu-copy-urls.js]
 [browser_styleinspector_csslogic-content-stylesheets.js]
 [browser_styleinspector_output-parser.js]
 [browser_styleinspector_refresh_when_active.js]
 [browser_styleinspector_tooltip-background-image.js]
 [browser_styleinspector_tooltip-closes-on-new-selection.js]
-skip-if = e10s || os == 'linux' # Bug 1111546 (e10s), bug 1093431 (linux)
+skip-if = e10s # Bug 1111546 (e10s)
 [browser_styleinspector_tooltip-longhand-fontfamily.js]
 [browser_styleinspector_tooltip-multiple-background-images.js]
 [browser_styleinspector_tooltip-shorthand-fontfamily.js]
 [browser_styleinspector_tooltip-size.js]
 skip-if = e10s || os == 'linux' # Bug 1111546 (e10s), bug 1093431 (linux)
 [browser_styleinspector_transform-highlighter-01.js]
 [browser_styleinspector_transform-highlighter-02.js]
 [browser_styleinspector_transform-highlighter-03.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
@@ -18,34 +18,50 @@ 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);
   yield onHidden;
 
   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);
   yield onHidden;
 
   ok(true, "Computed view tooltip closed after a new node got selected");