summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/test/browser_inspector_highlighter-01.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/inspector/test/browser_inspector_highlighter-01.js')
-rw-r--r--devtools/client/inspector/test/browser_inspector_highlighter-01.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/devtools/client/inspector/test/browser_inspector_highlighter-01.js b/devtools/client/inspector/test/browser_inspector_highlighter-01.js
new file mode 100644
index 000000000..946b8c3c8
--- /dev/null
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-01.js
@@ -0,0 +1,31 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+// Test that hovering over nodes in the markup-view shows the highlighter over
+// those nodes
+add_task(function* () {
+ info("Loading the test document and opening the inspector");
+ let {toolbox, inspector, testActor} = yield openInspectorForURL(
+ "data:text/html;charset=utf-8,<h1>foo</h1><span>bar</span>");
+
+ let isVisible = yield testActor.isHighlighting(toolbox);
+ ok(!isVisible, "The highlighter is hidden by default");
+
+ info("Selecting the test node");
+ yield selectNode("span", inspector);
+ let container = yield getContainerForSelector("h1", inspector);
+
+ let onHighlighterReady = toolbox.once("highlighter-ready");
+ EventUtils.synthesizeMouseAtCenter(container.tagLine, {type: "mousemove"},
+ inspector.markup.doc.defaultView);
+ yield onHighlighterReady;
+
+ isVisible = yield testActor.isHighlighting();
+ ok(isVisible, "The highlighter is shown on a markup container hover");
+
+ ok((yield testActor.assertHighlightedNode("h1")),
+ "The highlighter highlights the right node");
+});