Bug 1336806 - Disable animation of the bookmark popup panel during tests to aid timing and avoid intermittent issues. r?mak draft
authorMark Banner <standard8@mozilla.com>
Tue, 18 Jul 2017 19:23:20 +0100
changeset 611113 a1b36258e709441e630fe2ddcb71892c4941bb98
parent 610649 dece50457378ac4934afe9fb3c2a8054e8894588
child 638078 e09430e0e2e8bcfaf34b6d9e5c4eb84e333d4ef5
push id69131
push userbmo:standard8@mozilla.com
push dateWed, 19 Jul 2017 08:07:19 +0000
reviewersmak
bugs1336806
milestone56.0a1
Bug 1336806 - Disable animation of the bookmark popup panel during tests to aid timing and avoid intermittent issues. r?mak MozReview-Commit-ID: 115vkHVSEUm
browser/base/content/test/general/browser_bookmark_popup.js
--- a/browser/base/content/test/general/browser_bookmark_popup.js
+++ b/browser/base/content/test/general/browser_bookmark_popup.js
@@ -10,16 +10,23 @@
 
 let bookmarkPanel = document.getElementById("editBookmarkPanel");
 let bookmarkStar = AppConstants.MOZ_PHOTON_THEME ? BookmarkingUI.star : BookmarkingUI.button;
 let bookmarkPanelTitle = document.getElementById("editBookmarkPanelTitle");
 let editBookmarkPanelRemoveButtonRect;
 
 StarUI._closePanelQuickForTesting = true;
 
+add_task(async function setup() {
+  bookmarkPanel.setAttribute("animate", false);
+  registerCleanupFunction(() => {
+    bookmarkPanel.removeAttribute("animate");
+  });
+})
+
 async function test_bookmarks_popup({isNewBookmark, popupShowFn, popupEditFn,
                                 shouldAutoClose, popupHideFn, isBookmarkRemoved}) {
   await BrowserTestUtils.withNewTab({gBrowser, url: "about:home"}, async function(browser) {
     try {
       if (!isNewBookmark) {
         await PlacesUtils.bookmarks.insert({
           parentGuid: PlacesUtils.bookmarks.unfiledGuid,
           url: "about:home",
@@ -377,17 +384,17 @@ add_task(async function enter_on_remove_
 add_task(async function mouse_hovering_panel_should_prevent_autoclose() {
   if (AppConstants.platform != "win") {
     // This test requires synthesizing native mouse movement which is
     // best supported on Windows.
     return;
   }
   await test_bookmarks_popup({
     isNewBookmark: true,
-    async popupShowFn(browser) {
+    async popupShowFn() {
       await new Promise(resolve => {
         EventUtils.synthesizeNativeMouseMove(
           document.documentElement,
           editBookmarkPanelRemoveButtonRect.left,
           editBookmarkPanelRemoveButtonRect.top,
           resolve);
       });
       EventUtils.synthesizeKey("D", {accelKey: true}, window);