Bug 1336806 - Disable animation of the bookmark popup panel during tests to aid timing and avoid intermittent issues. r?mak
MozReview-Commit-ID: 115vkHVSEUm
--- 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);