forked from mirrors/gecko-dev
They fail on win7 only with my patch for bug 1805694 (tried win 10 with and without native menus and nothing, sigh) and I need to debug them. Let's do this while at it, this makes the test run on macOS and Linux too, since browser_selectpopup is sadly disabled on those platforms. Differential Revision: https://phabricator.services.mozilla.com/D164951
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
let SELECT = "<html><body><select id='one'>";
|
|
for (let i = 0; i < 75; i++) {
|
|
SELECT += ` <option>${i}${i}${i}${i}${i}</option>`;
|
|
}
|
|
SELECT +=
|
|
' <option selected="true">{"end": "true"}</option>' +
|
|
"</select></body></html>";
|
|
|
|
add_setup(async function() {
|
|
await SpecialPowers.pushPrefEnv({
|
|
set: [["dom.forms.selectSearch", true]],
|
|
});
|
|
});
|
|
|
|
add_task(async function test_focus_on_search_shouldnt_close_popup() {
|
|
const pageUrl = "data:text/html," + escape(SELECT);
|
|
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
|
|
let selectPopup = await openSelectPopup("mousedown");
|
|
|
|
let searchInput = selectPopup.querySelector(
|
|
".contentSelectDropdown-searchbox"
|
|
);
|
|
searchInput.scrollIntoView();
|
|
let searchFocused = BrowserTestUtils.waitForEvent(searchInput, "focus", true);
|
|
await EventUtils.synthesizeMouseAtCenter(searchInput, {}, window);
|
|
await searchFocused;
|
|
|
|
is(
|
|
selectPopup.state,
|
|
"open",
|
|
"select popup should still be open after clicking on the search field"
|
|
);
|
|
|
|
await hideSelectPopup("escape");
|
|
BrowserTestUtils.removeTab(tab);
|
|
});
|