Bug 1408166 - prevent search bar popup from ever showing when browser_940307_panel_click_closure_handling is running to avoid it interfering with context menu clicks, r=florian

MozReview-Commit-ID: jyRcdAKpxR

--HG--
extra : rebase_source : 66d4452809e8b66383bf8cfb02cfc695b9ade37a
This commit is contained in:
Gijs Kruitbosch 2017-11-07 10:54:10 +00:00
Родитель 646ed8e303
Коммит 974b0a4c68
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -38,6 +38,9 @@ add_task(async function searchbar_in_panel() {
// autocomplete panel and search for suggestions, which would
// trigger network requests. Temporarily disable suggestions.
await SpecialPowers.pushPrefEnv({set: [["browser.search.suggest.enabled", false]]});
let dontShowPopup = e => e.preventDefault();
let searchbarPopup = searchbar.textbox.popup;
searchbarPopup.addEventListener("popupshowing", dontShowPopup);
searchbar.value = "foo";
searchbar.focus();
@ -55,9 +58,6 @@ add_task(async function searchbar_in_panel() {
EventUtils.synthesizeMouseAtCenter(selectAll, {});
await contextMenuHidden;
// Hide the suggestion panel.
searchbar.textbox.popup.hidePopup();
ok(isOverflowOpen(), "Panel should still be open");
let hiddenPanelPromise = promiseOverflowHidden(window);
@ -65,6 +65,9 @@ add_task(async function searchbar_in_panel() {
await hiddenPanelPromise;
ok(!isOverflowOpen(), "Panel should no longer be open");
// Allow search bar popup to show again.
searchbarPopup.removeEventListener("popupshowing", dontShowPopup);
// We focused the search bar earlier - ensure we don't keep doing that.
gURLBar.select();