Backed out changeset 538c51598420 (bug 1659736) for perma failures on test_IE_bookmarks.js. CLOSED TREE

This commit is contained in:
Razvan Maries 2020-08-25 21:04:59 +03:00
Родитель 26fc2c0843
Коммит f916ec87b2
2 изменённых файлов: 8 добавлений и 34 удалений

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

@ -414,10 +414,11 @@ Bookmarks.prototype = {
_histogramBookmarkRoots: 0,
migrate: function B_migrate(aCallback) {
return (async () => {
await this._migrateFolder(
this._favoritesFolder,
PlacesUtils.bookmarks.menuGuid
);
// Import to the bookmarks menu.
this._histogramBookmarkRoots |=
MigrationUtils.SOURCE_BOOKMARK_ROOTS_BOOKMARKS_MENU;
let folderGuid = PlacesUtils.bookmarks.menuGuid;
await this._migrateFolder(this._favoritesFolder, folderGuid);
Services.telemetry
.getKeyedHistogramById("FX_MIGRATION_BOOKMARKS_ROOTS")
.add(
@ -450,15 +451,6 @@ Bookmarks.prototype = {
aDestFolderGuid
);
}
if (aDestFolderGuid == PlacesUtils.bookmarks.menuGuid) {
this._histogramBookmarkRoots |=
MigrationUtils.SOURCE_BOOKMARK_ROOTS_BOOKMARKS_MENU;
} else if (aDestFolderGuid == PlacesUtils.bookmarks.toolbarGuid) {
this._histogramBookmarkRoots |=
MigrationUtils.SOURCE_BOOKMARK_ROOTS_BOOKMARKS_TOOLBAR;
}
await MigrationUtils.insertManyBookmarksWrapper(bookmarks, aDestFolderGuid);
},
@ -481,6 +473,9 @@ Bookmarks.prototype = {
entry.leafName == this._toolbarFolderName &&
entry.parent.equals(this._favoritesFolder);
if (isBookmarksFolder && entry.isReadable()) {
// Import to the bookmarks toolbar.
this._histogramBookmarkRoots |=
MigrationUtils.SOURCE_BOOKMARK_ROOTS_BOOKMARKS_TOOLBAR;
let folderGuid = PlacesUtils.bookmarks.toolbarGuid;
await this._migrateFolder(entry, folderGuid);
PlacesUIUtils.maybeToggleBookmarkToolbarVisibilityAfterMigration();

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

@ -13,18 +13,10 @@ add_task(async function() {
// on the actual favorites stored on the local machine's IE favorites database.
// As such, we can't assert that bookmarks were migrated to both the bookmarks
// menu and the bookmarks toolbar.
let bookmarkRoots = 0;
let itemCount = 0;
let listener = events => {
for (let event of events) {
if (event.itemType == PlacesUtils.bookmarks.TYPE_BOOKMARK) {
if (event.parentGuid == PlacesUtils.bookmarks.toolbarGuid) {
bookmarkRoots |=
MigrationUtils.SOURCE_BOOKMARK_ROOTS_BOOKMARKS_TOOLBAR;
} else if (event.parentGuid == PlacesUtils.bookmarks.menuGuid) {
bookmarkRoots |= MigrationUtils.SOURCE_BOOKMARK_ROOTS_BOOKMARKS_MENU;
}
info("bookmark added: " + event.parentGuid);
itemCount++;
}
}
@ -53,19 +45,6 @@ add_task(async function() {
itemCount,
"Ensure telemetry matches actual number of imported items."
);
await TestUtils.waitForCondition(() => {
let snapshot = Services.telemetry.getSnapshotForKeyedHistograms(
"main",
false
).parent.FX_MIGRATION_BOOKMARKS_ROOTS;
if (!snapshot || !snapshot.ie) {
return false;
}
let sum = arr => Object.values(arr).reduce((a, b) => a + b, 0);
let sumOfValues = sum(snapshot.ie.values);
info(`Expected ${bookmarkRoots}, got ${sumOfValues}`);
return sumOfValues == bookmarkRoots;
}, "Wait until telemetry is updated");
// Check the bookmarks have been imported to all the expected parents.
Assert.ok(observerNotified, "The observer should be notified upon migration");