-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1913976 - mobileBookmarks folder is missing in Bookmarks menu. a=…
…pascalc Original Revision: https://phabricator.services.mozilla.com/D220383 Differential Revision: https://phabricator.services.mozilla.com/D220438
- Loading branch information
Showing
3 changed files
with
75 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
browser/components/places/tests/browser/browser_mobile_root_on_bookmark_menus.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
"use strict"; | ||
|
||
let { PlacesSyncUtils } = ChromeUtils.importESModule( | ||
"resource://gre/modules/PlacesSyncUtils.sys.mjs" | ||
); | ||
|
||
add_setup(async function () { | ||
// There should be at least one bookmark in the mobile root. | ||
await PlacesUtils.bookmarks.insert({ | ||
url: "https://www.mozilla.org/", | ||
parentGuid: PlacesUtils.bookmarks.mobileGuid, | ||
}); | ||
await PlacesSyncUtils.bookmarks.ensureMobileQuery(); | ||
CustomizableUI.addWidgetToArea( | ||
"bookmarks-menu-button", | ||
CustomizableUI.AREA_NAVBAR, | ||
4 | ||
); | ||
|
||
registerCleanupFunction(async function () { | ||
CustomizableUI.reset(); | ||
await PlacesUtils.bookmarks.eraseEverything(); | ||
}); | ||
}); | ||
|
||
add_task(async function test() { | ||
for (let { popup, mobileMenuitem } of [ | ||
{ | ||
popup: document.getElementById("BMB_bookmarksPopup"), | ||
mobileMenuitem: document.getElementById("BMB_mobileBookmarks"), | ||
}, | ||
{ | ||
popup: document.getElementById("bookmarksMenuPopup"), | ||
mobileMenuitem: document.getElementById("menu_mobileBookmarks"), | ||
}, | ||
]) { | ||
info("Open bookmarks popup."); | ||
let shownPromise = BrowserTestUtils.waitForEvent( | ||
popup, | ||
"popupshowing", | ||
false, | ||
e => e.target == popup | ||
); | ||
// Simulates popup opening causing it to populate. We cannot just open | ||
// normally since it would not work on Mac native menubar. | ||
popup.dispatchEvent( | ||
new MouseEvent("popupshowing", { | ||
bubbles: true, | ||
}) | ||
); | ||
await shownPromise; | ||
|
||
Assert.ok(!mobileMenuitem.hidden, "Check mobile root is not hidden."); | ||
} | ||
}); |