Backed out changeset 5f9ccc7b6039 (bug 1515810) for failing in browser_ext_contextMenus.js
authorNoemi Erli <nerli@mozilla.com>
Mon, 14 Jan 2019 18:58:15 +0200
changeset 453754 6573f476d87a23ad9a25413587df39e1ef0fb483
parent 453753 aa50cd5b75d80b2f00b5ff8b337b1f9c88183922
child 453755 2f97d93c3a2d694fb828c8692d7a53739f5b4a98
push id35372
push usercbrindusan@mozilla.com
push dateMon, 14 Jan 2019 21:49:33 +0000
treeherdermozilla-central@50b3268954b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1515810
milestone66.0a1
backs out5f9ccc7b603903a2af362bc990e52bf6f059d398
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
Backed out changeset 5f9ccc7b6039 (bug 1515810) for failing in browser_ext_contextMenus.js
browser/components/extensions/test/browser/browser_ext_contextMenus.js
browser/components/extensions/test/browser/browser_ext_menus.js
browser/components/extensions/test/browser/head.js
--- a/browser/components/extensions/test/browser/browser_ext_contextMenus.js
+++ b/browser/components/extensions/test/browser/browser_ext_contextMenus.js
@@ -558,32 +558,33 @@ function bookmarkContextMenuExtension() 
       });
     },
   });
 }
 
 add_task(async function test_bookmark_contextmenu() {
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, PAGE);
 
-  await toggleBookmarksToolbar(true);
+  const bookmarksToolbar = document.getElementById("PersonalToolbar");
+  setToolbarVisibility(bookmarksToolbar, true);
 
   const extension = bookmarkContextMenuExtension();
 
   await extension.startup();
   await extension.awaitMessage("bookmark-created");
   let menu = await openChromeContextMenu(
     "placesContext",
     "#PersonalToolbar .bookmark-item:last-child");
 
   let menuItem = menu.getElementsByAttribute("label", "Get bookmark")[0];
   closeChromeContextMenu("placesContext", menuItem);
 
   await extension.awaitMessage("test-finish");
   await extension.unload();
-  await toggleBookmarksToolbar(false);
+  setToolbarVisibility(bookmarksToolbar, false);
 
   BrowserTestUtils.removeTab(tab);
 });
 
 add_task(async function test_bookmark_sidebar_contextmenu() {
   await withSidebarTree("bookmarks", async (tree) => {
     let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, PAGE);
 
@@ -667,17 +668,18 @@ add_task(async function test_organizer_c
     await extension.unload();
   }
 
   await promiseLibraryClosed(library);
   BrowserTestUtils.removeTab(tab);
 });
 
 add_task(async function test_bookmark_context_requires_permission() {
-  await toggleBookmarksToolbar(true);
+  const bookmarksToolbar = document.getElementById("PersonalToolbar");
+  setToolbarVisibility(bookmarksToolbar, true);
 
   const extension = ExtensionTestUtils.loadExtension({
     manifest: {
       permissions: ["contextMenus"],
     },
     background() {
       browser.contextMenus.create({
         title: "Get bookmark",
@@ -694,10 +696,10 @@ add_task(async function test_bookmark_co
     "#PersonalToolbar .bookmark-item:last-child");
 
   Assert.equal(menu.getElementsByAttribute("label", "Get bookmark").length, 0,
                "bookmark context menu not created with `bookmarks` permission.");
 
   closeChromeContextMenu("placesContext");
 
   await extension.unload();
-  await toggleBookmarksToolbar(false);
+  setToolbarVisibility(bookmarksToolbar, false);
 });
--- a/browser/components/extensions/test/browser/browser_ext_menus.js
+++ b/browser/components/extensions/test/browser/browser_ext_menus.js
@@ -160,44 +160,53 @@ add_task(async function test_hiddenPageA
   await closeChromeContextMenu(menu.id);
   await closeChromeContextMenu(BrowserPageActions.panelNode.id);
 
   BrowserTestUtils.removeTab(tab);
   await extension.unload();
 });
 
 add_task(async function test_bookmarkContextMenu() {
+  async function showBookmarksToolbar(visible = true) {
+    let bt = document.getElementById("PersonalToolbar");
+    let transitionPromise =
+      BrowserTestUtils.waitForEvent(bt, "transitionend",
+                                    e => e.propertyName == "max-height");
+    setToolbarVisibility(bt, visible);
+    await transitionPromise;
+  }
+
   const ext = ExtensionTestUtils.loadExtension({
     manifest: {
       permissions: ["menus", "bookmarks"],
     },
     background() {
       browser.menus.onShown.addListener(() => {
         browser.test.sendMessage("hello");
       });
       browser.menus.create({title: "blarg", contexts: ["bookmark"]}, () => {
         browser.test.sendMessage("ready");
       });
     },
   });
 
-  await toggleBookmarksToolbar(true);
+  await showBookmarksToolbar();
   await ext.startup();
   await ext.awaitMessage("ready");
 
   let menu = await openChromeContextMenu("placesContext",
                                          "#PlacesToolbarItems .bookmark-item");
   let children = Array.from(menu.children);
   let item = children[children.length - 1];
   is(item.label, "blarg", "Menu item label is correct");
   await ext.awaitMessage("hello"); // onShown listener fired
 
   closeChromeContextMenu("placesContext", item);
   await ext.unload();
-  await toggleBookmarksToolbar(false);
+  await showBookmarksToolbar(false);
 });
 
 add_task(async function test_tabContextMenu() {
   const first = ExtensionTestUtils.loadExtension({
     manifest: {
       permissions: ["menus"],
     },
     async background() {
--- a/browser/components/extensions/test/browser/head.js
+++ b/browser/components/extensions/test/browser/head.js
@@ -3,17 +3,16 @@
 "use strict";
 
 /* exported CustomizableUI makeWidgetId focusWindow forceGC
  *          getBrowserActionWidget
  *          clickBrowserAction clickPageAction
  *          getBrowserActionPopup getPageActionPopup getPageActionButton
  *          closeBrowserAction closePageAction
  *          promisePopupShown promisePopupHidden
- *          toggleBookmarksToolbar
  *          openContextMenu closeContextMenu
  *          openContextMenuInSidebar openContextMenuInPopup
  *          openExtensionContextMenu closeExtensionContextMenu
  *          openActionContextMenu openSubmenu closeActionContextMenu
  *          openTabContextMenu closeTabContextMenu
  *          openToolsMenu closeToolsMenu
  *          imageBuffer imageBufferFromDataURI
  *          getListStyleImage getPanelForNode
@@ -283,26 +282,16 @@ function closeBrowserAction(extension, w
   let group = getBrowserActionWidget(extension);
 
   let node = win.document.getElementById(group.viewId);
   CustomizableUI.hidePanelForNode(node);
 
   return Promise.resolve();
 }
 
-async function toggleBookmarksToolbar(visible = true) {
-  let bookmarksToolbar = document.getElementById("PersonalToolbar");
-  let transitionPromise =
-    BrowserTestUtils.waitForEvent(bookmarksToolbar, "transitionend",
-                                  e => e.propertyName == "max-height");
-
-  setToolbarVisibility(bookmarksToolbar, visible);
-  await transitionPromise;
-}
-
 async function openContextMenuInPopup(extension, selector = "body") {
   let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
   let browser = await awaitExtensionPanel(extension);
   let popupShownPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popupshown");
   await BrowserTestUtils.synthesizeMouseAtCenter(selector, {type: "mousedown", button: 2}, browser);
   await BrowserTestUtils.synthesizeMouseAtCenter(selector, {type: "contextmenu"}, browser);
   await popupShownPromise;
   return contentAreaContextMenu;