summaryrefslogtreecommitdiffstats
path: root/layout/xul/test/browser_bug703210.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /layout/xul/test/browser_bug703210.js
parentInitial commit. (diff)
downloadfirefox-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 'layout/xul/test/browser_bug703210.js')
-rw-r--r--layout/xul/test/browser_bug703210.js56
1 files changed, 56 insertions, 0 deletions
diff --git a/layout/xul/test/browser_bug703210.js b/layout/xul/test/browser_bug703210.js
new file mode 100644
index 0000000000..5026875310
--- /dev/null
+++ b/layout/xul/test/browser_bug703210.js
@@ -0,0 +1,56 @@
+add_task(async function () {
+ const url =
+ "data:text/html," +
+ "<html onmousemove='event.stopPropagation()'" +
+ " onmouseenter='event.stopPropagation()' onmouseleave='event.stopPropagation()'" +
+ " onmouseover='event.stopPropagation()' onmouseout='event.stopPropagation()'>" +
+ '<p id="p1" title="tooltip is here">This paragraph has a tooltip.</p>' +
+ '<p id="p2">This paragraph doesn\'t have tooltip.</p></html>';
+
+ let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
+ let browser = gBrowser.selectedBrowser;
+
+ await new Promise(resolve => {
+ SpecialPowers.pushPrefEnv({ set: [["ui.tooltipDelay", 0]] }, resolve);
+ });
+
+ let popupShownPromise = BrowserTestUtils.waitForEvent(
+ document,
+ "popupshown",
+ false,
+ event => {
+ is(event.originalTarget.localName, "tooltip", "tooltip is showing");
+ return true;
+ }
+ );
+ let popupHiddenPromise = BrowserTestUtils.waitForEvent(
+ document,
+ "popuphidden",
+ false,
+ event => {
+ is(event.originalTarget.localName, "tooltip", "tooltip is hidden");
+ return true;
+ }
+ );
+
+ // Send a mousemove at a known position to start the test.
+ await BrowserTestUtils.synthesizeMouseAtCenter(
+ "#p2",
+ { type: "mousemove" },
+ browser
+ );
+ await BrowserTestUtils.synthesizeMouseAtCenter(
+ "#p1",
+ { type: "mousemove" },
+ browser
+ );
+ await popupShownPromise;
+ await BrowserTestUtils.synthesizeMouseAtCenter(
+ "#p2",
+ { type: "mousemove" },
+ browser
+ );
+ await popupHiddenPromise;
+
+ gBrowser.removeCurrentTab();
+});