Bug 1671587 - fix perma-fail of test_Chrome_bookmarks.js when the 2020h2 pref gets flipped, r=jaws

Differential Revision: https://phabricator.services.mozilla.com/D94030
This commit is contained in:
Gijs Kruitbosch 2020-10-19 16:16:21 +00:00
Родитель cd454d0141
Коммит 1eb312de26
1 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -7,6 +7,10 @@ const { CustomizableUI } = ChromeUtils.import(
"resource:///modules/CustomizableUI.jsm"
);
const { PlacesUIUtils } = ChromeUtils.import(
"resource:///modules/PlacesUIUtils.jsm"
);
let rootDir = do_get_file("chromefiles/", true);
add_task(async function setup_fakePaths() {
@ -21,6 +25,23 @@ add_task(async function setup_fakePaths() {
registerFakePath(pathId, rootDir);
});
add_task(async function setup_initialBookmarks() {
let bookmarks = [];
for (let i = 0; i < PlacesUIUtils.NUM_TOOLBAR_BOOKMARKS_TO_UNHIDE + 1; i++) {
bookmarks.push({ url: "https://example.com/" + i, title: "" + i });
}
// Ensure we have enough items in both the menu and toolbar to trip creating a "from" folder.
await PlacesUtils.bookmarks.insertTree({
guid: PlacesUtils.bookmarks.toolbarGuid,
children: bookmarks,
});
await PlacesUtils.bookmarks.insertTree({
guid: PlacesUtils.bookmarks.menuGuid,
children: bookmarks,
});
});
async function testBookmarks(migratorKey, subDirs, folderName) {
if (AppConstants.platform == "macosx") {
subDirs.unshift("Application Support");