michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: "use strict"; michael@0: michael@0: // Test that when first hovering over a node and immediately after selecting it michael@0: // by clicking on it leaves the highlighter visible for as long as the mouse is michael@0: // over the node michael@0: michael@0: let test = asyncTest(function*() { michael@0: let {inspector} = yield addTab("data:text/html,
It's going to be legen....
").then(openInspector); michael@0: let p = getNode("p"); michael@0: michael@0: info("hovering over theline in the markup-view"); michael@0: yield hoverContainer(p, inspector); michael@0: ok(isHighlighterVisible(), "the highlighter is still visible"); michael@0: michael@0: info("selecting the
line by clicking in the markup-view"); michael@0: yield clickContainer(p, inspector); michael@0: michael@0: p.textContent = "wait for it ...."; michael@0: info("wait and see if the highlighter stays visible even after the node was selected"); michael@0: yield waitForTheBrieflyShowBoxModelTimeout(); michael@0: michael@0: let updated = inspector.once("inspector-updated"); michael@0: p.textContent = "dary!!!!"; michael@0: ok(isHighlighterVisible(), "the highlighter is still visible"); michael@0: yield updated; michael@0: }); michael@0: michael@0: function waitForTheBrieflyShowBoxModelTimeout() { michael@0: let deferred = promise.defer(); michael@0: // Note that the current timeout is 1 sec and is neither configurable nor michael@0: // exported anywhere we can access, so hard-coding the timeout michael@0: content.setTimeout(deferred.resolve, 1500); michael@0: return deferred.promise; michael@0: }