Bug 1819423 - Add support for importing synced bookmarks for Chrome-based browsers. r=kpatenio.

Differential Revision: https://phabricator.services.mozilla.com/D173391
This commit is contained in:
Angel_V129 2023-04-05 15:34:01 +00:00
Родитель 8c2db1ae86
Коммит cf4248bb7d
2 изменённых файлов: 19 добавлений и 4 удалений

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

@ -488,6 +488,21 @@ async function GetBookmarksResource(aProfileFolder, aBrowserKey) {
);
}
// Importing synced Bookmarks items
if (roots.synced.children && roots.synced.children.length) {
// Synced Bookmarks
let parentGuid = lazy.PlacesUtils.bookmarks.unfiledGuid;
let bookmarks = convertBookmarks(
roots.synced.children,
bookmarkURLAccumulator,
errorGatherer
);
await MigrationUtils.insertManyBookmarksWrapper(
bookmarks,
parentGuid
);
}
// Find all favicons with associated bookmarks
let favicons = [];
for (let bookmark of bookmarkURLAccumulator) {

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

@ -197,8 +197,8 @@ async function testBookmarks(migratorKey, subDirs) {
Assert.equal(
postUnfiledCount - initialUnfiledCount,
105,
"Should have seen 105 items in unsorted bookmarks"
210,
"Should have seen 210 items in unsorted bookmarks"
);
Assert.equal(
postToolbarCount - initialToolbarCount,
@ -213,8 +213,8 @@ async function testBookmarks(migratorKey, subDirs) {
PlacesUtils.observers.removeListener(["bookmark-added"], listener);
Assert.equal(itemsSeen.bookmarks, 200, "Should have seen 200 bookmarks.");
Assert.equal(itemsSeen.folders, 10, "Should have seen 10 folders.");
Assert.equal(itemsSeen.bookmarks, 300, "Should have seen 300 bookmarks.");
Assert.equal(itemsSeen.folders, 15, "Should have seen 15 folders.");
Assert.equal(
MigrationUtils._importQuantities.bookmarks,
itemsSeen.bookmarks + itemsSeen.folders,