browser/devtools/markupview/test/browser_markupview_highlight_hover_02.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* vim: set ts=2 et sw=2 tw=80: */
michael@0 2 /* Any copyright is dedicated to the Public Domain.
michael@0 3 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 4
michael@0 5 "use strict";
michael@0 6
michael@0 7 // Test that when after an element is selected and highlighted on hover, if the
michael@0 8 // mouse leaves the markup-view and comes back again on the same element, that
michael@0 9 // the highlighter is shown again on the node
michael@0 10
michael@0 11 let test = asyncTest(function*() {
michael@0 12 let {inspector} = yield addTab("data:text/html,<p>Select me!</p>").then(openInspector);
michael@0 13
michael@0 14 info("hover over the <p> line in the markup-view so that it's the currently hovered node");
michael@0 15 yield hoverContainer("p", inspector);
michael@0 16
michael@0 17 info("select the <p> markup-container line by clicking");
michael@0 18 yield clickContainer("p", inspector);
michael@0 19 ok(isHighlighterVisible(), "the highlighter is shown");
michael@0 20
michael@0 21 info("mouse-leave the markup-view");
michael@0 22 yield mouseLeaveMarkupView(inspector);
michael@0 23 ok(!isHighlighterVisible(), "the highlighter is hidden after mouseleave");
michael@0 24
michael@0 25 info("hover over the <p> line again, which is still selected");
michael@0 26 yield hoverContainer("p", inspector);
michael@0 27 ok(isHighlighterVisible(), "the highlighter is visible again");
michael@0 28 });

mercurial