Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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/ */
5 "use strict";
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
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");
15 info("hovering over the <p> line in the markup-view");
16 yield hoverContainer(p, inspector);
17 ok(isHighlighterVisible(), "the highlighter is still visible");
19 info("selecting the <p> line by clicking in the markup-view");
20 yield clickContainer(p, inspector);
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();
26 let updated = inspector.once("inspector-updated");
27 p.textContent = "dary!!!!";
28 ok(isHighlighterVisible(), "the highlighter is still visible");
29 yield updated;
30 });
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 }