Bug 1519514 - make sure document.l10n is initialized before triggering conext menu over a tab in browser_ext_menus_activeTab.js test r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D28366

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexander Surkov 2019-04-22 20:18:02 +00:00
Родитель bb64503da3
Коммит af181e17f0
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -39,6 +39,10 @@ async function openTwoTabsAndOpenTabMenu(onTabMenuClicked) {
await extension.startup(); await extension.startup();
await extension.awaitMessage("ready"); await extension.awaitMessage("ready");
// Focus a selected tab to to make tabbrowser.js to load localization files,
// and thereby initialize document.l10n property.
gBrowser.selectedTab.focus();
// The .tabbrowser-tab selector matches the first tab (tab1). // The .tabbrowser-tab selector matches the first tab (tab1).
let menu = await openChromeContextMenu("tabContextMenu", ".tabbrowser-tab", window); let menu = await openChromeContextMenu("tabContextMenu", ".tabbrowser-tab", window);
let menuItem = menu.getElementsByAttribute("label", "menu item on tab")[0]; let menuItem = menu.getElementsByAttribute("label", "menu item on tab")[0];