diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /devtools/client/inspector/markup/test/browser_markup_dragdrop_tooltip.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | devtools/client/inspector/markup/test/browser_markup_dragdrop_tooltip.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_dragdrop_tooltip.js b/devtools/client/inspector/markup/test/browser_markup_dragdrop_tooltip.js new file mode 100644 index 0000000000..30e5567bc4 --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_dragdrop_tooltip.js @@ -0,0 +1,36 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +// Test that tooltips don't appear when dragging over tooltip targets. + +const TEST_URL = 'data:text/html;charset=utf8,<img src="about:logo" /><div>'; + +add_task(async function () { + const { inspector } = await openInspectorForURL(TEST_URL); + const { markup } = inspector; + + info("Get the tooltip target element for the image's src attribute"); + const img = await getContainerForSelector("img", inspector); + const target = img.editor.getAttributeElement("src").querySelector(".link"); + + info("Check that the src attribute of the image is a valid tooltip target"); + await assertTooltipShownOnHover(markup.imagePreviewTooltip, target); + await assertTooltipHiddenOnMouseOut(markup.imagePreviewTooltip, target); + + info("Start dragging the test div"); + await simulateNodeDrag(inspector, "div"); + + info("Now check that the src attribute of the image isn't a valid target"); + const isValid = await markup.imagePreviewTooltip._toggle.isValidHoverTarget( + target + ); + ok(!isValid, "The element is not a valid tooltip target"); + + info("Stop dragging the test div"); + await simulateNodeDrop(inspector, "div"); + + info("Check again the src attribute of the image"); + await assertTooltipShownOnHover(markup.imagePreviewTooltip, target); + await assertTooltipHiddenOnMouseOut(markup.imagePreviewTooltip, target); +}); |