Bug 1703378 - Fix browser_ext_menus.js for proton urlbar. r=rpl
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 08 Apr 2021 18:57:28 +0000
changeset 575124 cb2b9d45ac60e60dcc6dbc3cd3bc19951ef2faba
parent 575123 7b35e3017b764ae12e06dc54365765b51814c5c9
child 575125 293cd8f2b1cda3e08f3b11e29ec0c903887deeab
push id38358
push userarchaeopteryx@coole-files.de
push dateFri, 09 Apr 2021 09:20:20 +0000
treeherdermozilla-central@7bc2dd06085f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrpl
bugs1703378
milestone89.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 1703378 - Fix browser_ext_menus.js for proton urlbar. r=rpl Differential Revision: https://phabricator.services.mozilla.com/D111271
browser/components/extensions/test/browser/browser_ext_menus.js
--- a/browser/components/extensions/test/browser/browser_ext_menus.js
+++ b/browser/components/extensions/test/browser/browser_ext_menus.js
@@ -168,16 +168,24 @@ add_task(async function test_actionConte
     is(tab.id, tabId, "Click event tab ID is correct");
   }
 
   BrowserTestUtils.removeTab(tab);
   await extension.unload();
 });
 
 add_task(async function test_hiddenPageActionContextMenu() {
+  // In Proton there's no page actions menu by default, there is only an
+  // overflow menu when the window is smaller than 680px. While currently
+  // disabled page actions are shown in that overflow menu, bug 1703889 will
+  // change the behavior, hiding them. Then this test won't be necessary anymore
+  // since the user won't be able to open the context menu on disabled actions.
+  await SpecialPowers.pushPrefEnv({
+    set: [["browser.proton.urlbar.enabled", false]],
+  });
   const manifest = {
     page_action: {},
     permissions: ["menus"],
   };
 
   async function background() {
     const contexts = ["page_action"];
 
@@ -214,16 +222,18 @@ add_task(async function test_hiddenPageA
   is(dontShowItem.label, "Remove from Address Bar", "Correct first child");
   is(separator.tagName, "menuseparator", "Correct second child");
   is(manageItem.label, "Manage Extension\u2026", "Correct third child");
   is(removeItem.label, "Remove Extension", "Correct fourth child");
 
   await closeChromeContextMenu(menu.id);
   await closeChromeContextMenu(BrowserPageActions.panelNode.id);
 
+  // Undo the Proton pref change.
+  await SpecialPowers.popPrefEnv();
   BrowserTestUtils.removeTab(tab);
   await extension.unload();
 });
 
 add_task(async function test_bookmarkContextMenu() {
   const ext = ExtensionTestUtils.loadExtension({
     manifest: {
       permissions: ["menus", "bookmarks"],