From 7443e3d6139ce4f0c822c23d1efb9c097419456d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 03:54:08 +0200 Subject: Merging upstream version 125.0.3. Signed-off-by: Daniel Baumann --- .../test/forms/browser_selectpopup_focus.js | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 browser/base/content/test/forms/browser_selectpopup_focus.js (limited to 'browser/base/content/test/forms/browser_selectpopup_focus.js') diff --git a/browser/base/content/test/forms/browser_selectpopup_focus.js b/browser/base/content/test/forms/browser_selectpopup_focus.js new file mode 100644 index 0000000000..24ff947c50 --- /dev/null +++ b/browser/base/content/test/forms/browser_selectpopup_focus.js @@ -0,0 +1,38 @@ +// Empty select to make sure that we click on the menulist button. +const PAGE = ` + + +`; + +function tick() { + return new Promise(r => + requestAnimationFrame(() => requestAnimationFrame(r)) + ); +} + +add_task(async function () { + const url = "data:text/html," + encodeURI(PAGE); + await BrowserTestUtils.withNewTab( + { + gBrowser, + url, + }, + async function (browser) { + await openSelectPopup("click"); + await SpecialPowers.spawn(browser, [], () => { + is( + content.document.activeElement, + content.document.querySelector("select"), + "Select is the active element" + ); + ok( + content.document.querySelector("select").matches(":focus"), + "Select matches :focus" + ); + }); + await hideSelectPopup(); + } + ); +}); -- cgit v1.2.3