diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/client/inspector/test/browser_inspector_highlighter-iframes_01.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/inspector/test/browser_inspector_highlighter-iframes_01.js')
-rw-r--r-- | devtools/client/inspector/test/browser_inspector_highlighter-iframes_01.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/devtools/client/inspector/test/browser_inspector_highlighter-iframes_01.js b/devtools/client/inspector/test/browser_inspector_highlighter-iframes_01.js new file mode 100644 index 000000000..6475937c4 --- /dev/null +++ b/devtools/client/inspector/test/browser_inspector_highlighter-iframes_01.js @@ -0,0 +1,64 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* 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"; + +// Testing that moving the mouse over the document with the element picker +// started highlights nodes + +const NESTED_FRAME_SRC = "data:text/html;charset=utf-8," + + "nested iframe<div>nested div</div>"; + +const OUTER_FRAME_SRC = "data:text/html;charset=utf-8," + + "little frame<div>little div</div>" + + "<iframe src='" + NESTED_FRAME_SRC + "' />"; + +const TEST_URI = "data:text/html;charset=utf-8," + + "iframe tests for inspector" + + "<iframe src=\"" + OUTER_FRAME_SRC + "\" />"; + +add_task(function* () { + let {inspector, testActor} = yield openInspectorForURL(TEST_URI); + let outerFrameDiv = ["iframe", "div"]; + let innerFrameDiv = ["iframe", "iframe", "div"]; + + info("Waiting for element picker to activate."); + yield startPicker(inspector.toolbox); + + info("Moving mouse over outerFrameDiv"); + yield moveMouseOver(outerFrameDiv); + ok((yield testActor.assertHighlightedNode(outerFrameDiv)), + "outerFrameDiv is highlighted."); + + info("Moving mouse over innerFrameDiv"); + yield moveMouseOver(innerFrameDiv); + ok((yield testActor.assertHighlightedNode(innerFrameDiv)), + "innerFrameDiv is highlighted."); + + info("Selecting root node"); + yield selectNode(inspector.walker.rootNode, inspector); + + info("Selecting an element from the nested iframe directly"); + let innerFrameFront = yield getNodeFrontInFrame("iframe", "iframe", + inspector); + let innerFrameDivFront = yield getNodeFrontInFrame("div", innerFrameFront, + inspector); + yield selectNode(innerFrameDivFront, inspector); + + is(inspector.breadcrumbs.nodeHierarchy.length, 9, + "Breadcrumbs have 9 items."); + + info("Waiting for element picker to deactivate."); + yield inspector.toolbox.highlighterUtils.stopPicker(); + + function moveMouseOver(selector) { + info("Waiting for element " + selector + " to be highlighted"); + testActor.synthesizeMouse({ + selector: selector, + options: {type: "mousemove"}, + center: true + }).then(() => inspector.toolbox.once("picker-node-hovered")); + } +}); |