Bug 1519514 - make sure document.l10n is initialized before triggering conext menu over a tab in browser_ext_menus_activeTab.js test r=Gijs
authorAlexander Surkov <surkov.alexander@gmail.com>
Mon, 22 Apr 2019 20:18:02 +0000
changeset 470417 fc479e4e17f208520ccfa4fd29bacc1a90ba4bfa
parent 470416 89f6237ef760987f550fa6a96d92268152cbbe0c
child 470418 e85cb54e594431e3b60f2e32cc6222872ba64f55
push id35905
push userdvarga@mozilla.com
push dateTue, 23 Apr 2019 09:53:27 +0000
treeherdermozilla-central@831918f009f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1519514
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
browser/components/extensions/test/browser/browser_ext_menus_activeTab.js
--- a/browser/components/extensions/test/browser/browser_ext_menus_activeTab.js
+++ b/browser/components/extensions/test/browser/browser_ext_menus_activeTab.js
@@ -34,16 +34,20 @@ async function openTwoTabsAndOpenTabMenu
       "permissions": ["menus", "activeTab"],
     },
     background: `(${background})(${onTabMenuClicked})`,
   });
 
   await extension.startup();
   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).
   let menu = await openChromeContextMenu("tabContextMenu", ".tabbrowser-tab", window);
   let menuItem = menu.getElementsByAttribute("label", "menu item on tab")[0];
   await closeTabContextMenu(menuItem);
   await extension.awaitMessage("onCommand_on_tab_click");
 
   await extension.unload();