|
1 /* vim: set ts=2 et sw=2 tw=80: */ |
|
2 /* Any copyright is dedicated to the Public Domain. |
|
3 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
4 |
|
5 "use strict"; |
|
6 |
|
7 // Test that when first hovering over a node and immediately after selecting it |
|
8 // by clicking on it leaves the highlighter visible for as long as the mouse is |
|
9 // over the node |
|
10 |
|
11 let test = asyncTest(function*() { |
|
12 let {inspector} = yield addTab("data:text/html,<p>It's going to be legen....</p>").then(openInspector); |
|
13 let p = getNode("p"); |
|
14 |
|
15 info("hovering over the <p> line in the markup-view"); |
|
16 yield hoverContainer(p, inspector); |
|
17 ok(isHighlighterVisible(), "the highlighter is still visible"); |
|
18 |
|
19 info("selecting the <p> line by clicking in the markup-view"); |
|
20 yield clickContainer(p, inspector); |
|
21 |
|
22 p.textContent = "wait for it ...."; |
|
23 info("wait and see if the highlighter stays visible even after the node was selected"); |
|
24 yield waitForTheBrieflyShowBoxModelTimeout(); |
|
25 |
|
26 let updated = inspector.once("inspector-updated"); |
|
27 p.textContent = "dary!!!!"; |
|
28 ok(isHighlighterVisible(), "the highlighter is still visible"); |
|
29 yield updated; |
|
30 }); |
|
31 |
|
32 function waitForTheBrieflyShowBoxModelTimeout() { |
|
33 let deferred = promise.defer(); |
|
34 // Note that the current timeout is 1 sec and is neither configurable nor |
|
35 // exported anywhere we can access, so hard-coding the timeout |
|
36 content.setTimeout(deferred.resolve, 1500); |
|
37 return deferred.promise; |
|
38 } |