diff --git a/browser/components/extensions/test/xpcshell/test_ext_bookmarks.js b/browser/components/extensions/test/xpcshell/test_ext_bookmarks.js index fce487445596..fed4f062fb75 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_bookmarks.js +++ b/browser/components/extensions/test/xpcshell/test_ext_bookmarks.js @@ -665,7 +665,7 @@ add_task(async function test_get_recent_with_tag_and_query() { PlacesUtils.tagging.tagURI(NetUtil.newURI("http://example.com/${i}"), ["Test Tag"]); // Add a query bookmark. - let queryURL = `place:folder=${PlacesUtils.bookmarksMenuFolderId}&queryType=1`; + let queryURL = `place:parent=${PlacesUtils.bookmarks.menuGuid}&queryType=1`; await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid, url: queryURL, diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index d63f2619d17f..13e6d554f86f 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -1824,7 +1824,7 @@ BrowserGlue.prototype = { // children, or if it has a persisted currentset value. let toolbarIsCustomized = xulStore.hasValue(BROWSER_DOCURL, "PersonalToolbar", "currentset"); let getToolbarFolderCount = () => { - let toolbarFolder = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root; + let toolbarFolder = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid).root; let toolbarChildCount = toolbarFolder.childCount; toolbarFolder.containerOpen = false; return toolbarChildCount; diff --git a/browser/components/places/tests/browser/browser_bookmark_folder_moveability.js b/browser/components/places/tests/browser/browser_bookmark_folder_moveability.js index 2dbd22742a4d..12249eecc821 100644 --- a/browser/components/places/tests/browser/browser_bookmark_folder_moveability.js +++ b/browser/components/places/tests/browser/browser_bookmark_folder_moveability.js @@ -23,7 +23,6 @@ add_task(async function() { title: "", type: PlacesUtils.bookmarks.TYPE_FOLDER, }); - let folderId = await PlacesUtils.promiseItemId(folder.guid); tree.selectItems([folder.guid]); Assert.equal(tree.selectedNode.bookmarkGuid, folder.guid, "Selected the expected node"); @@ -35,7 +34,7 @@ add_task(async function() { let shortcut = await PlacesUtils.bookmarks.insert({ parentGuid: root.guid, title: "bar", - url: `place:folder=${folderId}` + url: `place:parent=${folder.guid}` }); tree.selectItems([shortcut.guid]); Assert.equal(tree.selectedNode.bookmarkGuid, shortcut.guid, @@ -94,11 +93,10 @@ add_task(async function() { tree.selectItems([guid]); Assert.ok(!tree.controller.canMoveNode(tree.selectedNode), "shouldn't be able to move default shortcuts to roots"); - let id = await PlacesUtils.promiseItemId(guid); let s = await PlacesUtils.bookmarks.insert({ parentGuid: root.guid, title: "bar", - url: `place:folder=${id}`, + url: `place:parent=${guid}`, }); tree.selectItems([s.guid]); Assert.equal(tree.selectedNode.bookmarkGuid, s.guid, diff --git a/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js b/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js index 8fb84d7c4a4a..3f3049841d74 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js @@ -124,7 +124,7 @@ add_task(async function test_try_move_root_in_sidebar() { "Should have copied the folder title."); Assert.equal(newFolder.type, PlacesUtils.bookmarks.TYPE_BOOKMARK, "Should have a bookmark type (for a folder shortcut)."); - Assert.equal(newFolder.url, "place:folder=BOOKMARKS_MENU", + Assert.equal(newFolder.url, `place:parent=${PlacesUtils.bookmarks.menuGuid}`, "Should have the correct url for the folder shortcut."); }); diff --git a/browser/components/places/tests/browser/browser_copy_query_without_tree.js b/browser/components/places/tests/browser/browser_copy_query_without_tree.js index fa302fe480b9..6bd43931db80 100644 --- a/browser/components/places/tests/browser/browser_copy_query_without_tree.js +++ b/browser/components/places/tests/browser/browser_copy_query_without_tree.js @@ -4,7 +4,6 @@ /* test that copying a non movable query or folder shortcut makes a new query with the same url, not a deep copy */ -const SHORTCUT_URL = "place:folder=2"; const QUERY_URL = "place:sort=8&maxResults=10"; add_task(async function copy_toolbar_shortcut() { diff --git a/browser/components/places/tests/browser/browser_library_infoBox.js b/browser/components/places/tests/browser/browser_library_infoBox.js index 4a4b9ae97163..8c93242fc934 100644 --- a/browser/components/places/tests/browser/browser_library_infoBox.js +++ b/browser/components/places/tests/browser/browser_library_infoBox.js @@ -75,7 +75,7 @@ add_task(async function() { // open recently bookmarked node await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.menuGuid, - url: "place:folder=BOOKMARKS_MENU&folder=UNFILED_BOOKMARKS&folder=TOOLBAR" + + url: "place:" + PlacesUtils.bookmarks.userContentRoots.map(guid => `parent=${guid}`).join("&") + "&queryType=" + Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS + "&sort=" + Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_DESCENDING + "&maxResults=10" + diff --git a/browser/components/places/tests/chrome/test_bug1163447_selectItems_through_shortcut.xul b/browser/components/places/tests/chrome/test_bug1163447_selectItems_through_shortcut.xul index 8f8706d188cf..5b1abb45ba66 100644 --- a/browser/components/places/tests/chrome/test_bug1163447_selectItems_through_shortcut.xul +++ b/browser/components/places/tests/chrome/test_bug1163447_selectItems_through_shortcut.xul @@ -48,7 +48,7 @@ parentGuid: bmu.toolbarGuid, index: bmu.DEFAULT_INDEX, type: bmu.TYPE_BOOKMARK, - url: "place:folder=TOOLBAR", + url: `place:parent=${PlacesUtils.bookmarks.toolbarGuid}`, title: "shortcut to self - causing infinite recursion if not handled properly" }); @@ -56,7 +56,7 @@ parentGuid: bmu.toolbarGuid, index: bmu.DEFAULT_INDEX, type: bmu.TYPE_BOOKMARK, - url: "place:folder=UNFILED_BOOKMARKS", + url: `place:parent=${PlacesUtils.bookmarks.unfiledGuid}`, title: "shortcut to unfiled, within toolbar" }); @@ -69,7 +69,7 @@ // Setup the places tree contents. let tree = document.getElementById("tree"); - tree.place = "place:folder=TOOLBAR"; + tree.place = `place:parent=${PlacesUtils.bookmarks.toolbarGuid}`; // Select the folder via the selectItems(folder.guid) API being tested tree.selectItems([folder.guid]); diff --git a/browser/components/places/tests/chrome/test_selectItems_on_nested_tree.xul b/browser/components/places/tests/chrome/test_selectItems_on_nested_tree.xul index b545660c9582..075fc16d04b6 100644 --- a/browser/components/places/tests/chrome/test_selectItems_on_nested_tree.xul +++ b/browser/components/places/tests/chrome/test_selectItems_on_nested_tree.xul @@ -44,7 +44,7 @@ parentGuid: PlacesUtils.bookmarks.unfiledGuid, index: PlacesUtils.bookmarks.DEFAULT_INDEX, type: PlacesUtils.bookmarks.TYPE_BOOKMARK, - url: "place:folder=UNFILED_BOOKMARKS", + url: `place:parent=${PlacesUtils.bookmarks.unfiledGuid}`, title: "shortcut" }); @@ -52,7 +52,7 @@ parentGuid: PlacesUtils.bookmarks.unfiledGuid, index: PlacesUtils.bookmarks.DEFAULT_INDEX, type: PlacesUtils.bookmarks.TYPE_BOOKMARK, - url: "place:folder=UNFILED_BOOKMARKS&maxResults=10", + url: `place:parent=${PlacesUtils.bookmarks.unfiledGuid}&maxResults=10`, title: "query" }); @@ -73,7 +73,7 @@ // Setup the places tree contents. let tree = document.getElementById("tree"); - tree.place = "place:folder=UNFILED_BOOKMARKS"; + tree.place = `place:parent=${PlacesUtils.bookmarks.unfiledGuid}`; // Select the last bookmark. tree.selectItems([bm.guid]); diff --git a/browser/components/places/tests/unit/test_browserGlue_smartBookmarks.js b/browser/components/places/tests/unit/test_browserGlue_smartBookmarks.js index 79e4de516657..9544eac67886 100644 --- a/browser/components/places/tests/unit/test_browserGlue_smartBookmarks.js +++ b/browser/components/places/tests/unit/test_browserGlue_smartBookmarks.js @@ -22,8 +22,8 @@ function run_test() { registerCleanupFunction(() => PlacesUtils.bookmarks.eraseEverything()); -function countFolderChildren(aFolderItemId) { - let rootNode = PlacesUtils.getFolderContents(aFolderItemId).root; +function countFolderChildren(aFolderGuid) { + let rootNode = PlacesUtils.getFolderContents(aFolderGuid).root; let cc = rootNode.childCount; // Dump contents. for (let i = 0; i < cc ; i++) { @@ -73,9 +73,9 @@ add_task(async function test_version_0() { await rebuildSmartBookmarks(); // Count items. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); // Check version has been updated. @@ -99,9 +99,9 @@ add_task(async function test_version_change() { Assert.equal(bm.title, "new title"); // Sanity check items. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); // Set preferences. @@ -110,9 +110,9 @@ add_task(async function test_version_change() { await rebuildSmartBookmarks(); // Count items. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); // Check smart bookmark has been replaced, itemId has changed. @@ -132,9 +132,9 @@ add_task(async function test_version_change_pos() { info("bookmarks position is retained when version changes."); // Sanity check items. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); let bm = await PlacesUtils.bookmarks.fetch({ @@ -150,9 +150,9 @@ add_task(async function test_version_change_pos() { await rebuildSmartBookmarks(); // Count items. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); // Check smart bookmarks are still in correct position. @@ -172,9 +172,9 @@ add_task(async function test_version_change_pos_moved() { info("moved bookmarks position is retained when version changes."); // Sanity check items. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); let bm1 = await PlacesUtils.bookmarks.fetch({ @@ -203,9 +203,9 @@ add_task(async function test_version_change_pos_moved() { await rebuildSmartBookmarks(); // Count items. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); bm1 = await PlacesUtils.bookmarks.fetch({ @@ -238,9 +238,9 @@ add_task(async function test_recreation() { await PlacesUtils.bookmarks.remove(bm.guid); // Sanity check items. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); // Set preferences. @@ -250,9 +250,9 @@ add_task(async function test_recreation() { // Count items. // We should not have recreated the smart bookmark on toolbar. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); // Check version has been updated. @@ -264,9 +264,9 @@ add_task(async function test_recreation_version_0() { info("Even if a smart bookmark has been removed recreate it if version is 0."); // Sanity check items. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); // Set preferences. @@ -276,9 +276,9 @@ add_task(async function test_recreation_version_0() { // Count items. // We should not have recreated the smart bookmark on toolbar. - Assert.equal(countFolderChildren(PlacesUtils.toolbarFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.toolbarGuid), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR); - Assert.equal(countFolderChildren(PlacesUtils.bookmarksMenuFolderId), + Assert.equal(countFolderChildren(PlacesUtils.bookmarks.menuGuid), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU); // Check version has been updated. diff --git a/browser/components/preferences/selectBookmark.js b/browser/components/preferences/selectBookmark.js index 6a673d45fcf5..d42d27bfde82 100644 --- a/browser/components/preferences/selectBookmark.js +++ b/browser/components/preferences/selectBookmark.js @@ -65,7 +65,7 @@ var SelectBookmarkDialog = { var names = []; var selectedNode = bookmarks.selectedNode; if (PlacesUtils.nodeIsFolder(selectedNode)) { - var contents = PlacesUtils.getFolderContents(selectedNode.itemId).root; + var contents = PlacesUtils.getFolderContents(selectedNode.bookmarkGuid).root; var cc = contents.childCount; for (var i = 0; i < cc; ++i) { var node = contents.getChild(i); diff --git a/toolkit/components/places/PlacesTransactions.jsm b/toolkit/components/places/PlacesTransactions.jsm index b5a634c70927..32c656107336 100644 --- a/toolkit/components/places/PlacesTransactions.jsm +++ b/toolkit/components/places/PlacesTransactions.jsm @@ -1448,8 +1448,7 @@ PT.SortByName.prototype = { // This is not great, since it does main-thread IO. // PromiseBookmarksTree can't be used, since it' won't stop at the first level'. - let folderId = await PlacesUtils.promiseItemId(guid); - let root = PlacesUtils.getFolderContents(folderId, false, false).root; + let root = PlacesUtils.getFolderContents(guid, false, false).root; for (let i = 0; i < root.childCount; ++i) { let node = root.getChild(i); oldOrderGuids.push(node.bookmarkGuid); diff --git a/toolkit/components/places/PlacesUtils.jsm b/toolkit/components/places/PlacesUtils.jsm index 91084d696b5f..7ed3ef061d65 100644 --- a/toolkit/components/places/PlacesUtils.jsm +++ b/toolkit/components/places/PlacesUtils.jsm @@ -857,7 +857,7 @@ var PlacesUtils = { if (PlacesUtils.nodeIsFolder(node) && node.type != Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT && asQuery(node).queryOptions.excludeItems) { - let folderRoot = PlacesUtils.getFolderContents(node.itemId, false, true).root; + let folderRoot = PlacesUtils.getFolderContents(node.bookmarkGuid, false, true).root; try { return gatherDataFunc(folderRoot); } finally { @@ -1145,7 +1145,7 @@ var PlacesUtils = { /** * Generates a nsINavHistoryResult for the contents of a folder. - * @param folderId + * @param aFolderGuid * The folder to open * @param [optional] excludeItems * True to hide all items (individual bookmarks). This is used on @@ -1157,13 +1157,12 @@ var PlacesUtils = { * @returns A nsINavHistoryResult containing the contents of the * folder. The result.root is guaranteed to be open. */ - getFolderContents: - function PU_getFolderContents(aFolderId, aExcludeItems, aExpandQueries) { - if (typeof aFolderId !== "number") { - throw new Error("aFolderId should be a number."); + getFolderContents(aFolderGuid, aExcludeItems, aExpandQueries) { + if (!this.isValidGuid(aFolderGuid)) { + throw new Error("aFolderGuid should be a valid GUID."); } var query = this.history.getNewQuery(); - query.setFolders([aFolderId], 1); + query.setParents([aFolderGuid], 1); var options = this.history.getNewQueryOptions(); options.excludeItems = aExcludeItems; options.expandQueries = aExpandQueries; diff --git a/toolkit/components/places/tests/bookmarks/test_384228.js b/toolkit/components/places/tests/bookmarks/test_384228.js index 143b9d3d8b6b..4f974291cb5e 100644 --- a/toolkit/components/places/tests/bookmarks/test_384228.js +++ b/toolkit/components/places/tests/bookmarks/test_384228.js @@ -74,16 +74,12 @@ add_task(async function search_bookmark_in_folder() { // query folder 1, folder 2 and get 4 bookmarks - let folderIds = []; - folderIds.push(await PlacesUtils.promiseItemId(testFolder1.guid)); - folderIds.push(await PlacesUtils.promiseItemId(testFolder2.guid)); - let hs = PlacesUtils.history; let options = hs.getNewQueryOptions(); let query = hs.getNewQuery(); query.searchTerms = "title"; options.queryType = options.QUERY_TYPE_BOOKMARKS; - query.setFolders(folderIds, folderIds.length); + query.setParents([testFolder1.guid, testFolder2.guid], 2); let rootNode = hs.executeQuery(query, options).root; rootNode.containerOpen = true; diff --git a/toolkit/components/places/tests/bookmarks/test_385829.js b/toolkit/components/places/tests/bookmarks/test_385829.js index bcbce7a26f6a..ab21db7e2c9c 100644 --- a/toolkit/components/places/tests/bookmarks/test_385829.js +++ b/toolkit/components/places/tests/bookmarks/test_385829.js @@ -66,9 +66,7 @@ add_task(async function search_bookmark_by_lastModified_dateDated() { let query = hs.getNewQuery(); options.queryType = options.QUERY_TYPE_BOOKMARKS; options.maxResults = 3; - let folderIds = []; - folderIds.push(await PlacesUtils.promiseItemId(folder.guid)); - query.setFolders(folderIds, 1); + query.setParents([folder.guid], 1); let result = hs.executeQuery(query, options); let rootNode = result.root; diff --git a/toolkit/components/places/tests/bookmarks/test_393498.js b/toolkit/components/places/tests/bookmarks/test_393498.js index a43a385253ae..784d8ac7cca7 100644 --- a/toolkit/components/places/tests/bookmarks/test_393498.js +++ b/toolkit/components/places/tests/bookmarks/test_393498.js @@ -97,8 +97,7 @@ add_task(async function test_bookmark_update_notifications() { updatedBookmark.lastModified.getTime())); // Check that node properties are updated. - let testFolderId = await PlacesUtils.promiseItemId(testFolder.guid); - let root = PlacesUtils.getFolderContents(testFolderId).root; + let root = PlacesUtils.getFolderContents(testFolder.guid).root; Assert.equal(root.childCount, 1); let childNode = root.getChild(0); diff --git a/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js b/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js index ae6389d66aa4..bf1f7c9f14d1 100644 --- a/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js +++ b/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js @@ -82,13 +82,7 @@ var test = { let insertedBookmarks = await PlacesUtils.bookmarks.insertTree(bookmarksTree); // create a query URI with 1 folder (ie: folder shortcut) - let folderIdsMap = await PlacesUtils.promiseManyItemIds(this._folderGuids); - let folderIds = []; - for (let id of folderIdsMap.values()) { - folderIds.push(id); - } - - this._queryURI1 = `place:folder=${folderIdsMap.get(this._folderGuids[0])}&queryType=1`; + this._queryURI1 = `place:parent=${this._folderGuids[0]}&queryType=1`; this._queryTitle1 = "query1"; await PlacesUtils.bookmarks.insert({ parentGuid: insertedBookmarks[0].guid, @@ -98,7 +92,7 @@ var test = { }); // create a query URI with _count folders - this._queryURI2 = `place:folder=${folderIds.join("&folder=")}&queryType=1`; + this._queryURI2 = `place:parent=${this._folderGuids.join("&parent=")}&queryType=1`; this._queryTitle2 = "query2"; await PlacesUtils.bookmarks.insert({ parentGuid: insertedBookmarks[0].guid, @@ -135,7 +129,7 @@ var test = { } var toolbar = - PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId, + PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid, false, true).root; Assert.equal(toolbar.childCount, 1); diff --git a/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js b/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js index 910061279a90..b846e1747717 100644 --- a/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js +++ b/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js @@ -7,7 +7,7 @@ const FOLDER_TITLE = '"quoted folder"'; function checkQuotedFolder() { - let toolbar = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarFolder).root; + let toolbar = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid).root; // test for our quoted folder Assert.equal(toolbar.childCount, 1); diff --git a/toolkit/components/places/tests/bookmarks/test_448584.js b/toolkit/components/places/tests/bookmarks/test_448584.js index e6432dd66f7f..899cd0df1beb 100644 --- a/toolkit/components/places/tests/bookmarks/test_448584.js +++ b/toolkit/components/places/tests/bookmarks/test_448584.js @@ -21,7 +21,7 @@ const ITEM_URL = "http://test.mozilla.org"; function validateResults(expectedValidItemsCount) { var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); var options = PlacesUtils.history.getNewQueryOptions(); var result = PlacesUtils.history.executeQuery(query, options); diff --git a/toolkit/components/places/tests/bookmarks/test_458683.js b/toolkit/components/places/tests/bookmarks/test_458683.js index 64a6ecb68ccb..3859c82a1baf 100644 --- a/toolkit/components/places/tests/bookmarks/test_458683.js +++ b/toolkit/components/places/tests/bookmarks/test_458683.js @@ -15,7 +15,7 @@ const ITEM_URL = "http://test.mozilla.org/"; const TAG_NAME = "testTag"; function validateResults() { - let toolbar = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root; + let toolbar = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid).root; // test for our bookmark Assert.equal(toolbar.childCount, 1); for (var i = 0; i < toolbar.childCount; i++) { @@ -44,7 +44,7 @@ add_task(async function() { // create a tag PlacesUtils.tagging.tagURI(Services.io.newURI(ITEM_URL), [TAG_NAME]); // get tag folder id - let tagRoot = PlacesUtils.getFolderContents(PlacesUtils.tagsFolderId).root; + let tagRoot = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.tagsGuid).root; Assert.equal(tagRoot.childCount, 1); let tagItemGuid = PlacesUtils.asContainer(tagRoot.getChild(0)).bookmarkGuid; tagRoot.containerOpen = false; diff --git a/toolkit/components/places/tests/bookmarks/test_818587_compress-bookmarks-backups.js b/toolkit/components/places/tests/bookmarks/test_818587_compress-bookmarks-backups.js index 0d4f0664d8aa..24c46708e5d6 100644 --- a/toolkit/components/places/tests/bookmarks/test_818587_compress-bookmarks-backups.js +++ b/toolkit/components/places/tests/bookmarks/test_818587_compress-bookmarks-backups.js @@ -42,7 +42,7 @@ add_task(async function compress_bookmark_backups_test() { let recentBackup = await PlacesBackups.getMostRecentBackup(); await PlacesUtils.bookmarks.remove(bm); await BookmarkJSONUtils.importFromFile(recentBackup, { replace: true }); - let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid).root; let node = root.getChild(0); Assert.equal(node.uri, url); diff --git a/toolkit/components/places/tests/bookmarks/test_992901-backup-unsorted-hierarchy.js b/toolkit/components/places/tests/bookmarks/test_992901-backup-unsorted-hierarchy.js index 99fad92dddf1..2eb1d020d325 100644 --- a/toolkit/components/places/tests/bookmarks/test_992901-backup-unsorted-hierarchy.js +++ b/toolkit/components/places/tests/bookmarks/test_992901-backup-unsorted-hierarchy.js @@ -40,7 +40,7 @@ add_task(async function() { { replace: true }); info("Checking first level"); - let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid).root; let level1 = root.getChild(0); Assert.equal(level1.title, "f1"); info("Checking second level"); diff --git a/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js b/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js index 94eaadcb7dcb..c7f8f709a65f 100644 --- a/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js +++ b/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js @@ -24,7 +24,7 @@ add_task(async function() { await BookmarkHTMLUtils.importFromFile(file, { replace: true }); info("Checking first level"); - let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid).root; let node = root.getChild(0); Assert.equal(node.uri, url); diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_getRecent.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_getRecent.js index e53976377909..95415f793eb7 100644 --- a/toolkit/components/places/tests/bookmarks/test_bookmarks_getRecent.js +++ b/toolkit/components/places/tests/bookmarks/test_bookmarks_getRecent.js @@ -41,7 +41,7 @@ add_task(async function getRecent_returns_recent_bookmarks() { }); // Add a query bookmark. - let queryURL = `place:folder=${PlacesUtils.bookmarksMenuFolderId}&queryType=1`; + let queryURL = `place:parent=${PlacesUtils.bookmarks.menuGuid}&queryType=1`; let bm5 = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid, url: queryURL, title: "a test query" }); diff --git a/toolkit/components/places/tests/bookmarks/test_savedsearches.js b/toolkit/components/places/tests/bookmarks/test_savedsearches.js index 59a1c08e0c56..132fb48ebd0e 100644 --- a/toolkit/components/places/tests/bookmarks/test_savedsearches.js +++ b/toolkit/components/places/tests/bookmarks/test_savedsearches.js @@ -8,7 +8,6 @@ const searchTerm = "about"; var testRoot; -var testRootId; add_task(async function setup() { // create a folder to hold all the tests @@ -19,7 +18,6 @@ add_task(async function setup() { title: searchTerm, type: PlacesUtils.bookmarks.TYPE_FOLDER, }); - testRootId = await PlacesUtils.promiseItemId(testRoot.guid); }); add_task(async function test_savedsearches_bookmarks() { @@ -43,7 +41,7 @@ add_task(async function test_savedsearches_bookmarks() { let options = PlacesUtils.history.getNewQueryOptions(); options.expandQueries = 0; let query = PlacesUtils.history.getNewQuery(); - query.setFolders([testRootId], 1); + query.setParents([testRoot.guid], 1); let result = PlacesUtils.history.executeQuery(query, options); let rootNode = result.root; rootNode.containerOpen = true; @@ -69,7 +67,7 @@ add_task(async function test_savedsearches_bookmarks() { let options = PlacesUtils.history.getNewQueryOptions(); options.expandQueries = 1; let query = PlacesUtils.history.getNewQuery(); - query.setFolders([testRootId], 1); + query.setParents([testRoot.guid], 1); let result = PlacesUtils.history.executeQuery(query, options); let rootNode = result.root; rootNode.containerOpen = true; @@ -145,7 +143,7 @@ add_task(async function test_savedsearches_history() { var options = PlacesUtils.history.getNewQueryOptions(); options.expandQueries = 1; var query = PlacesUtils.history.getNewQuery(); - query.setFolders([testRootId], 1); + query.setParents([testRoot.guid], 1); var result = PlacesUtils.history.executeQuery(query, options); var rootNode = result.root; rootNode.containerOpen = true; diff --git a/toolkit/components/places/tests/bookmarks/test_untitled.js b/toolkit/components/places/tests/bookmarks/test_untitled.js index 656996511fd1..7f02d1189501 100644 --- a/toolkit/components/places/tests/bookmarks/test_untitled.js +++ b/toolkit/components/places/tests/bookmarks/test_untitled.js @@ -10,7 +10,7 @@ add_task(async function test_untitled_visited_bookmark() { }], }); - let {root: node} = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId); + let {root: node} = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid); try { let fxBmk = await PlacesUtils.bookmarks.insert({ @@ -39,7 +39,7 @@ add_task(async function test_untitled_visited_bookmark() { add_task(async function test_untitled_unvisited_bookmark() { let tbURI = uri("http://getthunderbird.com"); - let {root: node} = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId); + let {root: node} = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid); try { let tbBmk = await PlacesUtils.bookmarks.insert({ @@ -66,7 +66,7 @@ add_task(async function test_untitled_unvisited_bookmark() { }); add_task(async function test_untitled_folder() { - let {root: node} = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId); + let {root: node} = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid); try { let folder = await PlacesUtils.bookmarks.insert({ diff --git a/toolkit/components/places/tests/chrome/test_371798.xul b/toolkit/components/places/tests/chrome/test_371798.xul index 2ca46cfca6f8..573e54d43752 100644 --- a/toolkit/components/places/tests/chrome/test_371798.xul +++ b/toolkit/components/places/tests/chrome/test_371798.xul @@ -55,7 +55,7 @@ function promiseOnItemChanged() { }); // query for bookmarks - let rootNode = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root; + let rootNode = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid).root; // set up observer let promiseObserved = promiseOnItemChanged(); diff --git a/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js b/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js index 04da6ee27953..1be4767a7816 100644 --- a/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js +++ b/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js @@ -16,8 +16,8 @@ add_task(async function test_query_result_favicon_changed_on_child() { // Get the last 10 bookmarks added to the menu or the toolbar. let query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarksMenuFolderId, - PlacesUtils.toolbarFolderId], 2); + query.setParents([PlacesUtils.bookmarks.menuGuid, + PlacesUtils.bookmarks.toolbarGuid], 2); let options = PlacesUtils.history.getNewQueryOptions(); options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS; @@ -80,7 +80,7 @@ add_task(async function test_query_result_favicon_changed_not_affect_lastmodifie url: PAGE_URI2 }); - let result = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId); + let result = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.menuGuid); Assert.equal(result.root.childCount, 1, "Should have only one item in the query"); diff --git a/toolkit/components/places/tests/legacy/test_bookmarks.js b/toolkit/components/places/tests/legacy/test_bookmarks.js index 8e0df596af76..642f441c4dc8 100644 --- a/toolkit/components/places/tests/legacy/test_bookmarks.js +++ b/toolkit/components/places/tests/legacy/test_bookmarks.js @@ -107,6 +107,7 @@ add_task(async function test_bookmarks() { // this makes the tests more tolerant of changes to default_places.html let testRoot = bs.createFolder(root, "places bookmarks xpcshell tests", bs.DEFAULT_INDEX); + let testRootGuid = await PlacesUtils.promiseItemGuid(testRoot); Assert.equal(bookmarksObserver._itemAddedId, testRoot); Assert.equal(bookmarksObserver._itemAddedParent, root); Assert.equal(bookmarksObserver._itemAddedIndex, bmStartIndex); @@ -249,7 +250,7 @@ add_task(async function test_bookmarks() { try { let options = hs.getNewQueryOptions(); let query = hs.getNewQuery(); - query.setFolders([testRoot], 1); + query.setParents([testRootGuid], 1); let result = hs.executeQuery(query, options); let rootNode = result.root; rootNode.containerOpen = true; @@ -279,6 +280,7 @@ add_task(async function test_bookmarks() { let mURI = uri("http://multiple.uris.in.query"); let testFolder = bs.createFolder(testRoot, "test Folder", bs.DEFAULT_INDEX); + let testFolderGuid = await PlacesUtils.promiseItemGuid(testFolder); // add 2 bookmarks bs.insertBookmark(testFolder, mURI, bs.DEFAULT_INDEX, "title 1"); bs.insertBookmark(testFolder, mURI, bs.DEFAULT_INDEX, "title 2"); @@ -286,7 +288,7 @@ add_task(async function test_bookmarks() { // query let options = hs.getNewQueryOptions(); let query = hs.getNewQuery(); - query.setFolders([testFolder], 1); + query.setParents([testFolderGuid], 1); let result = hs.executeQuery(query, options); let rootNode = result.root; rootNode.containerOpen = true; @@ -383,7 +385,7 @@ add_task(async function test_bookmarks() { try { let options = hs.getNewQueryOptions(); let query = hs.getNewQuery(); - query.setFolders([testRoot], 1); + query.setParents([testRootGuid], 1); let result = hs.executeQuery(query, options); let rootNode = result.root; rootNode.containerOpen = true; @@ -441,10 +443,10 @@ add_task(async function test_bookmarks() { Assert.equal(bookmarksObserver._itemChangedProperty, "title"); Assert.equal(bookmarksObserver._itemChangedValue, title15expected); - testSimpleFolderResult(); + await testSimpleFolderResult(); }); -function testSimpleFolderResult() { +async function testSimpleFolderResult() { // the time before we create a folder, in microseconds // Workaround possible VM timers issues subtracting 1us. let beforeCreate = Date.now() * 1000 - 1; @@ -452,6 +454,7 @@ function testSimpleFolderResult() { // create a folder let parent = bs.createFolder(root, "test", bs.DEFAULT_INDEX); + let parentGuid = await PlacesUtils.promiseItemGuid(parent); // the time before we insert, in microseconds // Workaround possible VM timers issues subtracting 1ms. @@ -473,7 +476,7 @@ function testSimpleFolderResult() { let options = hs.getNewQueryOptions(); let query = hs.getNewQuery(); - query.setFolders([parent], 1); + query.setParents([parentGuid], 1); let result = hs.executeQuery(query, options); let rootNode = result.root; rootNode.containerOpen = true; @@ -506,20 +509,3 @@ function testSimpleFolderResult() { rootNode.containerOpen = false; } - -function getChildCount(aFolderId) { - let cc = -1; - try { - let options = hs.getNewQueryOptions(); - let query = hs.getNewQuery(); - query.setFolders([aFolderId], 1); - let result = hs.executeQuery(query, options); - let rootNode = result.root; - rootNode.containerOpen = true; - cc = rootNode.childCount; - rootNode.containerOpen = false; - } catch (ex) { - do_throw("getChildCount failed: " + ex); - } - return cc; -} diff --git a/toolkit/components/places/tests/queries/test_async.js b/toolkit/components/places/tests/queries/test_async.js index 750e18c0e3d1..2df12dd0acef 100644 --- a/toolkit/components/places/tests/queries/test_async.js +++ b/toolkit/components/places/tests/queries/test_async.js @@ -241,7 +241,7 @@ Test.prototype = { // Make a query. this.query = PlacesUtils.history.getNewQuery(); - this.query.setFolders([DataHelper.defaults.bookmark.parent], 1); + this.query.setParents([DataHelper.defaults.bookmark.parentGuid], 1); this.opts = PlacesUtils.history.getNewQueryOptions(); this.opts.asyncEnabled = true; this.result = PlacesUtils.history.executeQuery(this.query, this.opts); @@ -265,20 +265,17 @@ Test.prototype = { var DataHelper = { defaults: { bookmark: { - parent: PlacesUtils.bookmarks.unfiledBookmarksFolder, parentGuid: PlacesUtils.bookmarks.unfiledGuid, uri: "http://example.com/", title: "test bookmark" }, folder: { - parent: PlacesUtils.bookmarks.unfiledBookmarksFolder, parentGuid: PlacesUtils.bookmarks.unfiledGuid, title: "test folder" }, separator: { - parent: PlacesUtils.bookmarks.unfiledBookmarksFolder, parentGuid: PlacesUtils.bookmarks.unfiledGuid } }, diff --git a/toolkit/components/places/tests/queries/test_bookmarks.js b/toolkit/components/places/tests/queries/test_bookmarks.js index 1738a9c5a052..8bdd2ebb81de 100644 --- a/toolkit/components/places/tests/queries/test_bookmarks.js +++ b/toolkit/components/places/tests/queries/test_bookmarks.js @@ -19,7 +19,7 @@ add_task(async function test_eraseEverything() { ] }); - let unfiled = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; + let unfiled = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid).root; Assert.equal(unfiled.childCount, 1, "There should be 1 folder"); let folder = unfiled.getChild(0); // Test dateAdded and lastModified properties. @@ -28,7 +28,7 @@ add_task(async function test_eraseEverything() { Assert.equal(typeof folder.lastModified, "number"); Assert.ok(folder.lastModified > 0); - let root = PlacesUtils.getFolderContents(folder.itemId).root; + let root = PlacesUtils.getFolderContents(folder.bookmarkGuid).root; Assert.equal(root.childCount, 4, "The folder should have 4 children"); for (let i = 0; i < root.childCount; ++i) { let node = root.getChild(i); @@ -77,7 +77,7 @@ add_task(async function test_long_title() { url: "http://mozilla.org/", title, }); - let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid).root; root.containerOpen = true; Assert.equal(root.childCount, 1); let node = root.getChild(0); diff --git a/toolkit/components/places/tests/queries/test_excludeQueries.js b/toolkit/components/places/tests/queries/test_excludeQueries.js index 1d0c0a11c4a9..e00ead16f1e4 100644 --- a/toolkit/components/places/tests/queries/test_excludeQueries.js +++ b/toolkit/components/places/tests/queries/test_excludeQueries.js @@ -22,7 +22,7 @@ add_task(async function setup() { }); folderShortcut = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid, - url: "place:folder=TOOLBAR", + url: `place:parent=${PlacesUtils.bookmarks.toolbarGuid}`, title: "a bookmark" }); @@ -58,7 +58,7 @@ add_task(async function test_bookmarks_excludeQueries() { // When excluding queries, we exclude actual queries, but not folder shortcuts. let expectedGuids = [bm.guid, folderShortcut.guid]; let query = {}, options = {}; - let queryString = `place:folder=${PlacesUtils.unfiledBookmarksFolderId}&excludeQueries=1`; + let queryString = `place:parent=${PlacesUtils.bookmarks.unfiledGuid}&excludeQueries=1`; PlacesUtils.history.queryStringToQuery(queryString, query, options); let root = PlacesUtils.history.executeQuery(query.value, options.value).root; diff --git a/toolkit/components/places/tests/queries/test_history_queries_tags_liveUpdate.js b/toolkit/components/places/tests/queries/test_history_queries_tags_liveUpdate.js index 571813853202..361fddc55d71 100644 --- a/toolkit/components/places/tests/queries/test_history_queries_tags_liveUpdate.js +++ b/toolkit/components/places/tests/queries/test_history_queries_tags_liveUpdate.js @@ -95,7 +95,7 @@ add_task(function visits_query() { add_task(function bookmarks_query() { let [query, options] = newQueryWithOptions(); - query.setFolders([PlacesUtils.unfiledBookmarksFolderId], 1); + query.setParents([PlacesUtils.bookmarks.unfiledGuid], 1); testQueryContents(query, options, function(root) { compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root); for (let i = 0; i < root.childCount; i++) { diff --git a/toolkit/components/places/tests/queries/test_onlyBookmarked.js b/toolkit/components/places/tests/queries/test_onlyBookmarked.js index 4d58c08f5865..aeee1a7be30c 100644 --- a/toolkit/components/places/tests/queries/test_onlyBookmarked.js +++ b/toolkit/components/places/tests/queries/test_onlyBookmarked.js @@ -47,7 +47,7 @@ add_task(async function test_onlyBookmarked() { // Query var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.toolbarFolderId], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); query.onlyBookmarked = true; // query options diff --git a/toolkit/components/places/tests/queries/test_options_inherit.js b/toolkit/components/places/tests/queries/test_options_inherit.js index a39c7f302214..12ff68dfab4d 100644 --- a/toolkit/components/places/tests/queries/test_options_inherit.js +++ b/toolkit/components/places/tests/queries/test_options_inherit.js @@ -45,7 +45,7 @@ add_task(async function() { async function test_query(opts, expectedRootCc, expectedFolderCc, expectedQueryCc) { let query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.unfiledBookmarksFolderId], 1); + query.setParents([PlacesUtils.bookmarks.unfiledGuid], 1); let options = PlacesUtils.history.getNewQueryOptions(); for (const [o, v] of Object.entries(opts)) { info(`Setting ${o} to ${v}`); diff --git a/toolkit/components/places/tests/queries/test_queryMultipleFolder.js b/toolkit/components/places/tests/queries/test_queryMultipleFolder.js index 1229227c4771..7989582ffaa7 100644 --- a/toolkit/components/places/tests/queries/test_queryMultipleFolder.js +++ b/toolkit/components/places/tests/queries/test_queryMultipleFolder.js @@ -16,11 +16,10 @@ add_task(async function setup() { title: `Folder${i}` }); folderGuids.push(folder.guid); - folderIds.push(await PlacesUtils.promiseItemId(folder.guid)); for (let j = 0; j < 7; ++j) { let bm = await PlacesUtils.bookmarks.insert({ - parentGuid: (await PlacesUtils.promiseItemGuid(folderIds[i])), + parentGuid: folderGuids[i], url: `http://Bookmark${i}_${j}.com`, title: "" }); @@ -33,7 +32,7 @@ add_task(async function test_queryMultipleFolders_ids() { // using queryStringToQuery let query = {}, options = {}; let maxResults = 20; - let queryString = `place:${folderIds.map((id) => "folder=" + id).join("&")}&sort=5&maxResults=${maxResults}`; + let queryString = `place:${folderGuids.map(guid => "parent=" + guid).join("&")}&sort=5&maxResults=${maxResults}`; PlacesUtils.history.queryStringToQuery(queryString, query, options); let rootNode = PlacesUtils.history.executeQuery(query.value, options.value).root; rootNode.containerOpen = true; @@ -48,7 +47,7 @@ add_task(async function test_queryMultipleFolders_ids() { // using getNewQuery and getNewQueryOptions query = PlacesUtils.history.getNewQuery(); options = PlacesUtils.history.getNewQueryOptions(); - query.setFolders(folderIds, folderIds.length); + query.setParents(folderGuids, folderGuids.length); options.sortingMode = options.SORT_BY_URI_ASCENDING; options.maxResults = maxResults; rootNode = PlacesUtils.history.executeQuery(query, options).root; diff --git a/toolkit/components/places/tests/queries/test_querySerialization.js b/toolkit/components/places/tests/queries/test_querySerialization.js index 5b0ba25ea151..17e29a59da69 100644 --- a/toolkit/components/places/tests/queries/test_querySerialization.js +++ b/toolkit/components/places/tests/queries/test_querySerialization.js @@ -213,31 +213,32 @@ const querySwitches = [ }, // getFolders { - desc: "nsINavHistoryQuery.getFolders", + desc: "nsINavHistoryQuery.getParents", matches(aQuery1, aQuery2) { - var q1Folders = aQuery1.getFolders(); - var q2Folders = aQuery2.getFolders(); - if (q1Folders.length !== q2Folders.length) + var q1Parents = aQuery1.getParents(); + var q2Parents = aQuery2.getParents(); + if (q1Parents.length !== q2Parents.length) return false; - for (let i = 0; i < q1Folders.length; i++) { - if (!q2Folders.includes(q1Folders[i])) + for (let i = 0; i < q1Parents.length; i++) { + if (!q2Parents.includes(q1Parents[i])) return false; } - for (let i = 0; i < q2Folders.length; i++) { - if (!q1Folders.includes(q2Folders[i])) + for (let i = 0; i < q2Parents.length; i++) { + if (!q1Parents.includes(q2Parents[i])) return false; } return true; }, runs: [ function(aQuery, aQueryOptions) { - aQuery.setFolders([], 0); + aQuery.setParents([], 0); }, function(aQuery, aQueryOptions) { - aQuery.setFolders([PlacesUtils.placesRootId], 1); + aQuery.setParents([PlacesUtils.bookmarks.rootGuid], 1); }, function(aQuery, aQueryOptions) { - aQuery.setFolders([PlacesUtils.placesRootId, PlacesUtils.tagsFolderId], 2); + aQuery.setParents([PlacesUtils.bookmarks.rootGuid, + PlacesUtils.bookmarks.tagsGuid], 2); } ] }, diff --git a/toolkit/components/places/tests/queries/test_query_uri_liveupdate.js b/toolkit/components/places/tests/queries/test_query_uri_liveupdate.js index abf852649875..46414b39452c 100644 --- a/toolkit/components/places/tests/queries/test_query_uri_liveupdate.js +++ b/toolkit/components/places/tests/queries/test_query_uri_liveupdate.js @@ -11,7 +11,7 @@ add_task(async function test_results_as_tag_query() { ] }); - let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId, false, true).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid, false, true).root; Assert.equal(root.childCount, 3, "We should get 3 results"); let queryRoot = root.getChild(2); PlacesUtils.asContainer(queryRoot).containerOpen = true; diff --git a/toolkit/components/places/tests/queries/test_results-as-roots.js b/toolkit/components/places/tests/queries/test_results-as-roots.js index 120decf97502..b902e2d89002 100644 --- a/toolkit/components/places/tests/queries/test_results-as-roots.js +++ b/toolkit/components/places/tests/queries/test_results-as-roots.js @@ -4,21 +4,21 @@ const MOBILE_BOOKMARKS_PREF = "browser.bookmarks.showMobileBookmarks"; const expectedRoots = [{ title: "BookmarksToolbarFolderTitle", - uri: "place:folder=TOOLBAR", + uri: `place:parent=${PlacesUtils.bookmarks.toolbarGuid}`, guid: PlacesUtils.bookmarks.virtualToolbarGuid, }, { title: "BookmarksMenuFolderTitle", - uri: "place:folder=BOOKMARKS_MENU", + uri: `place:parent=${PlacesUtils.bookmarks.menuGuid}`, guid: PlacesUtils.bookmarks.virtualMenuGuid, }, { title: "OtherBookmarksFolderTitle", - uri: "place:folder=UNFILED_BOOKMARKS", + uri: `place:parent=${PlacesUtils.bookmarks.unfiledGuid}`, guid: PlacesUtils.bookmarks.virtualUnfiledGuid, }]; const expectedRootsWithMobile = [...expectedRoots, { title: "MobileBookmarksFolderTitle", - uri: "place:folder=MOBILE_BOOKMARKS", + uri: `place:parent=${PlacesUtils.bookmarks.mobileGuid}`, guid: PlacesUtils.bookmarks.virtualMobileGuid, }]; diff --git a/toolkit/components/places/tests/queries/test_search_tags.js b/toolkit/components/places/tests/queries/test_search_tags.js index 6b4e9e0b5024..240179cc1de1 100644 --- a/toolkit/components/places/tests/queries/test_search_tags.js +++ b/toolkit/components/places/tests/queries/test_search_tags.js @@ -27,7 +27,7 @@ add_task(async function test_search_for_tagged_bookmarks() { query.searchTerms = "elephant"; var options = PlacesUtils.history.getNewQueryOptions(); options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS; - query.setFolders([folder], 1); + query.setParents([folder.guid], 1); var result = PlacesUtils.history.executeQuery(query, options); var rootNode = result.root; diff --git a/toolkit/components/places/tests/queries/test_sorting.js b/toolkit/components/places/tests/queries/test_sorting.js index a7a19fe72cf8..2160104bf8e8 100644 --- a/toolkit/components/places/tests/queries/test_sorting.js +++ b/toolkit/components/places/tests/queries/test_sorting.js @@ -44,7 +44,7 @@ tests.push({ check() { // Query var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); query.onlyBookmarked = true; // query options @@ -115,7 +115,7 @@ tests.push({ check() { // Query var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); query.onlyBookmarked = true; // query options @@ -213,7 +213,7 @@ tests.push({ check() { // Query var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); query.onlyBookmarked = true; // query options @@ -318,7 +318,7 @@ tests.push({ check() { // Query var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); // query options var options = PlacesUtils.history.getNewQueryOptions(); @@ -416,7 +416,7 @@ tests.push({ check() { // Query var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); query.onlyBookmarked = true; // query options @@ -504,7 +504,7 @@ tests.push({ check() { // Query var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); query.onlyBookmarked = true; // query options @@ -600,7 +600,7 @@ tests.push({ check() { // Query var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); query.onlyBookmarked = true; // query options @@ -698,7 +698,7 @@ tests.push({ check() { // Query var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); query.onlyBookmarked = true; // query options diff --git a/toolkit/components/places/tests/sync/test_bookmark_value_changes.js b/toolkit/components/places/tests/sync/test_bookmark_value_changes.js index cb9225a8b462..266a24067bbd 100644 --- a/toolkit/components/places/tests/sync/test_bookmark_value_changes.js +++ b/toolkit/components/places/tests/sync/test_bookmark_value_changes.js @@ -970,7 +970,7 @@ add_task(async function test_rewrite_tag_queries() { "Should retain existing tag"); let { root: toolbarContainer } = PlacesUtils.getFolderContents( - PlacesUtils.toolbarFolderId, false, true); + PlacesUtils.bookmarks.toolbarGuid, false, true); equal(toolbarContainer.childCount, 3, "Should add queries and bookmark to toolbar"); diff --git a/toolkit/components/places/tests/unit/test_1085291.js b/toolkit/components/places/tests/unit/test_1085291.js index c2a131dd6370..01f680b5db12 100644 --- a/toolkit/components/places/tests/unit/test_1085291.js +++ b/toolkit/components/places/tests/unit/test_1085291.js @@ -3,7 +3,7 @@ add_task(async function() { // have the extra bookmark properties (bookmarkGuid, dateAdded, lastModified). // getFolderContents opens the root node. - let root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid).root; async function insertAndTest(bmInfo) { bmInfo = await PlacesUtils.bookmarks.insert(bmInfo); @@ -23,7 +23,7 @@ add_task(async function() { await insertAndTest({ parentGuid: root.bookmarkGuid, type: PlacesUtils.bookmarks.TYPE_BOOKMARK, title: "Test Query", - url: "place:folder=BOOKMARKS_MENU" }); + url: `place:parent=${PlacesUtils.bookmarks.menuGuid}` }); // folder await insertAndTest({ parentGuid: root.bookmarkGuid, diff --git a/toolkit/components/places/tests/unit/test_1105208.js b/toolkit/components/places/tests/unit/test_1105208.js index d09d79b4859c..e1166c88fa78 100644 --- a/toolkit/components/places/tests/unit/test_1105208.js +++ b/toolkit/components/places/tests/unit/test_1105208.js @@ -7,16 +7,14 @@ add_task(async function() { title: "fake" }); - let folderId = await PlacesUtils.promiseItemId(folder.guid); - let shortcutInfo = await PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK, parentGuid: PlacesUtils.bookmarks.unfiledGuid, - url: `place:folder=${folderId}` + url: `place:parent=${folder.guid}` }); let unfiledRoot = - PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; + PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid).root; let shortcutNode = unfiledRoot.getChild(unfiledRoot.childCount - 1); Assert.equal(shortcutNode.bookmarkGuid, shortcutInfo.guid); diff --git a/toolkit/components/places/tests/unit/test_1105866.js b/toolkit/components/places/tests/unit/test_1105866.js index cae0abc110cd..a9a507e65be4 100644 --- a/toolkit/components/places/tests/unit/test_1105866.js +++ b/toolkit/components/places/tests/unit/test_1105866.js @@ -2,11 +2,11 @@ add_task(async function test_folder_shortcuts() { let shortcutInfo = await PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK, parentGuid: PlacesUtils.bookmarks.unfiledGuid, - url: "place:folder=TOOLBAR" + url: `place:parent=${PlacesUtils.bookmarks.toolbarGuid}` }); let unfiledRoot = - PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; + PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid).root; let shortcutNode = unfiledRoot.getChild(unfiledRoot.childCount - 1); Assert.strictEqual(shortcutNode.itemId, await PlacesUtils.promiseItemId(shortcutInfo.guid)); @@ -20,7 +20,7 @@ add_task(async function test_folder_shortcuts() { shortcutInfo = await PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK, parentGuid: PlacesUtils.bookmarks.unfiledGuid, - url: "place:folder=BOOKMARKS_MENU" + url: `place:parent=${PlacesUtils.bookmarks.menuGuid}` }); shortcutNode = unfiledRoot.getChild(unfiledRoot.childCount - 1); Assert.strictEqual(shortcutNode.itemId, @@ -41,7 +41,7 @@ add_task(async function test_plain_folder() { }); let unfiledRoot = - PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; + PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid).root; let lastChild = unfiledRoot.getChild(unfiledRoot.childCount - 1); Assert.strictEqual(lastChild.bookmarkGuid, folderInfo.guid); Assert.strictEqual(PlacesUtils.asQuery(lastChild).targetFolderGuid, diff --git a/toolkit/components/places/tests/unit/test_331487.js b/toolkit/components/places/tests/unit/test_331487.js index 506d5660746d..0811b9c2c238 100644 --- a/toolkit/components/places/tests/unit/test_331487.js +++ b/toolkit/components/places/tests/unit/test_331487.js @@ -40,8 +40,6 @@ add_task(async function test_hierarchical_query() { let [folderGuid, b1, sf1, b2, sf2, b3] = bookmarks.map((bookmark) => bookmark.guid); - let testFolderId = await PlacesUtils.promiseItemId(folderGuid); - // bookmark query that should result in the "hierarchical" result // because there is one query, one folder, // no begin time, no end time, no domain, no uri, no search term @@ -50,7 +48,7 @@ add_task(async function test_hierarchical_query() { var options = histsvc.getNewQueryOptions(); options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS; var query = histsvc.getNewQuery(); - query.setFolders([testFolderId], 1); + query.setParents([folderGuid], 1); var result = histsvc.executeQuery(query, options); var root = result.root; root.containerOpen = true; @@ -83,7 +81,7 @@ add_task(async function test_hierarchical_query() { options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS; options.maxResults = 10; query = histsvc.getNewQuery(); - query.setFolders([testFolderId], 1); + query.setParents([folderGuid], 1); result = histsvc.executeQuery(query, options); root = result.root; root.containerOpen = true; diff --git a/toolkit/components/places/tests/unit/test_384370.js b/toolkit/components/places/tests/unit/test_384370.js index d7d295a34ac9..9d86a076dd08 100644 --- a/toolkit/components/places/tests/unit/test_384370.js +++ b/toolkit/components/places/tests/unit/test_384370.js @@ -80,7 +80,7 @@ async function validate(infoMsg) { // Tests a bookmarks datastore that has a set of bookmarks, etc // that flex each supported field and feature. async function testMenuBookmarks() { - let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.menuGuid).root; Assert.equal(root.childCount, 3); let separatorNode = root.getChild(1); @@ -124,7 +124,7 @@ async function testMenuBookmarks() { } async function testToolbarBookmarks() { - let root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid).root; // child count (add 3 for pre-existing items) Assert.equal(root.childCount, bookmarkData.length + 3); @@ -158,7 +158,7 @@ async function testToolbarBookmarks() { } function testUnfiledBookmarks() { - let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid).root; // child count (add 1 for pre-existing item) Assert.equal(root.childCount, bookmarkData.length + 1); for (let i = 1; i < root.childCount; ++i) { diff --git a/toolkit/components/places/tests/unit/test_399264_query_to_string.js b/toolkit/components/places/tests/unit/test_399264_query_to_string.js deleted file mode 100644 index f1cfd06d94a3..000000000000 --- a/toolkit/components/places/tests/unit/test_399264_query_to_string.js +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * Obtains the id of the folder obtained from the query. - * - * @param aFolderID - * The id of the folder we want to generate a query for. - * @returns the string representation of the query for the given folder. - */ -function query_string(aFolderID) { - var hs = Cc["@mozilla.org/browser/nav-history-service;1"]. - getService(Ci.nsINavHistoryService); - - var query = hs.getNewQuery(); - query.setFolders([aFolderID], 1); - var options = hs.getNewQueryOptions(); - return hs.queryToQueryString(query, options); -} - -function run_test() { - const QUERIES = [ - "folder=PLACES_ROOT", - "folder=BOOKMARKS_MENU", - "folder=TAGS", - "folder=UNFILED_BOOKMARKS", - "folder=TOOLBAR" - ]; - const FOLDER_IDS = [ - PlacesUtils.placesRootId, - PlacesUtils.bookmarksMenuFolderId, - PlacesUtils.tagsFolderId, - PlacesUtils.unfiledBookmarksFolderId, - PlacesUtils.toolbarFolderId, - ]; - - for (var i = 0; i < QUERIES.length; i++) { - var result = query_string(FOLDER_IDS[i]); - dump("Looking for '" + QUERIES[i] + "' in '" + result + "'\n"); - Assert.notEqual(-1, result.indexOf(QUERIES[i])); - } -} diff --git a/toolkit/components/places/tests/unit/test_399264_string_to_query.js b/toolkit/components/places/tests/unit/test_399264_string_to_query.js deleted file mode 100644 index 26bbc54772c2..000000000000 --- a/toolkit/components/places/tests/unit/test_399264_string_to_query.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * Obtains the id of the folder obtained from the query. - * - * @param aQuery - * The query to obtain the folder id from. - * @returns the folder id of the folder of the root node of the query. - */ -function folder_id(aQuery) { - info("Checking query '" + aQuery + "'\n"); - let query = {}, options = {}; - PlacesUtils.history.queryStringToQuery(aQuery, query, options); - var result = PlacesUtils.history.executeQuery(query.value, options.value); - var root = result.root; - root.containerOpen = true; - Assert.ok(root.hasChildren); - var folderID = root.getChild(0).parent.itemId; - root.containerOpen = false; - return folderID; -} - -add_task(async function test_history_string_to_query() { - const QUERIES = [ - "place:folder=PLACES_ROOT", - "place:folder=BOOKMARKS_MENU", - "place:folder=TAGS", - "place:folder=UNFILED_BOOKMARKS", - "place:folder=TOOLBAR" - ]; - const FOLDER_IDS = [ - PlacesUtils.placesRootId, - PlacesUtils.bookmarksMenuFolderId, - PlacesUtils.tagsFolderId, - PlacesUtils.unfiledBookmarksFolderId, - PlacesUtils.toolbarFolderId, - ]; - - // add something in the bookmarks menu folder so a query to it returns results - await PlacesUtils.bookmarks.insert({ - parentGuid: PlacesUtils.bookmarks.menuGuid, - title: "bmf", - url: "http://example.com/bmf/", - }); - - // add something to the tags folder - PlacesUtils.tagging.tagURI(uri("http://www.example.com/"), ["tag"]); - - // add something to the unfiled bookmarks folder - await PlacesUtils.bookmarks.insert({ - parentGuid: PlacesUtils.bookmarks.unfiledGuid, - title: "ubf", - url: "http://example.com/ubf/", - }); - - // add something to the toolbar folder - await PlacesUtils.bookmarks.insert({ - parentGuid: PlacesUtils.bookmarks.toolbarGuid, - title: "tf", - url: "http://example.com/tf/", - }); - - for (let i = 0; i < QUERIES.length; i++) { - let result = folder_id(QUERIES[i]); - Assert.equal(FOLDER_IDS[i], result); - } -}); diff --git a/toolkit/components/places/tests/unit/test_419792_node_tags_property.js b/toolkit/components/places/tests/unit/test_419792_node_tags_property.js index a8749e96136c..a6fe948ecb04 100644 --- a/toolkit/components/places/tests/unit/test_419792_node_tags_property.js +++ b/toolkit/components/places/tests/unit/test_419792_node_tags_property.js @@ -14,7 +14,7 @@ add_task(async function test_query_node_tags_property() { // get toolbar node var options = histsvc.getNewQueryOptions(); var query = histsvc.getNewQuery(); - query.setFolders([PlacesUtils.toolbarFolderId], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); var result = histsvc.executeQuery(query, options); var toolbarNode = result.root; toolbarNode.containerOpen = true; diff --git a/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js b/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js index 6d2ad458a6c5..0ed51d97bb0b 100644 --- a/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js +++ b/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js @@ -21,15 +21,13 @@ add_task(async function test_query_with_remove_shortcut() { type: PlacesUtils.bookmarks.TYPE_FOLDER, }); - let folderId = await PlacesUtils.promiseItemId(folder.guid); - let query = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid, title: "", - url: `place:folder=${folderId}`, + url: `place:parent=${folder.guid}`, }); - var root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId, false, true).root; + var root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid, false, true).root; var oldCount = root.childCount; diff --git a/toolkit/components/places/tests/unit/test_433317_query_title_update.js b/toolkit/components/places/tests/unit/test_433317_query_title_update.js index e5c76584b0fb..f3f1ea05225e 100644 --- a/toolkit/components/places/tests/unit/test_433317_query_title_update.js +++ b/toolkit/components/places/tests/unit/test_433317_query_title_update.js @@ -22,7 +22,7 @@ add_task(async function test_query_title_update() { // query for that query var options = histsvc.getNewQueryOptions(); let query = histsvc.getNewQuery(); - query.setFolders([PlacesUtils.toolbarFolderId], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); var result = histsvc.executeQuery(query, options); var root = result.root; root.containerOpen = true; diff --git a/toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js b/toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js index 0a859d45e6f4..0ab1fd12bcfa 100644 --- a/toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js +++ b/toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js @@ -39,7 +39,7 @@ add_task(async function test_execute() { // query for that query options = histsvc.getNewQueryOptions(); query = histsvc.getNewQuery(); - query.setFolders([PlacesUtils.toolbarFolderId], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); result = histsvc.executeQuery(query, options); root = result.root; root.containerOpen = true; diff --git a/toolkit/components/places/tests/unit/test_async_transactions.js b/toolkit/components/places/tests/unit/test_async_transactions.js index 53ac3c936571..50f7b5b236ba 100644 --- a/toolkit/components/places/tests/unit/test_async_transactions.js +++ b/toolkit/components/places/tests/unit/test_async_transactions.js @@ -1538,8 +1538,7 @@ add_task(async function test_sort_folder_by_name() { } }); - let folderId = await PlacesUtils.promiseItemId(folder_info.guid); - let folderContainer = PlacesUtils.getFolderContents(folderId).root; + let folderContainer = PlacesUtils.getFolderContents(folder_info.guid).root; function ensureOrder(aOrder) { for (let i = 0; i < folderContainer.childCount; i++) { Assert.equal(folderContainer.getChild(i).bookmarkGuid, aOrder[i].guid); diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html.js b/toolkit/components/places/tests/unit/test_bookmarks_html.js index 2692c4159080..abac7632d951 100644 --- a/toolkit/components/places/tests/unit/test_bookmarks_html.js +++ b/toolkit/components/places/tests/unit/test_bookmarks_html.js @@ -267,18 +267,7 @@ async function testImportedBookmarks() { for (let group in test_bookmarks) { info("[testImportedBookmarks()] Checking group '" + group + "'"); - let root; - switch (group) { - case "menu": - root = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root; - break; - case "toolbar": - root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root; - break; - case "unfiled": - root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; - break; - } + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks[`${group}Guid`]).root; let items = test_bookmarks[group]; Assert.equal(root.childCount, items.length); diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js b/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js index 2ffd79b7a828..829e4ce57351 100644 --- a/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js +++ b/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js @@ -53,7 +53,7 @@ add_task(async function test_corrupt_database() { */ var database_check = async function() { // BOOKMARKS MENU - let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.menuGuid).root; Assert.equal(root.childCount, 2); let folderNode = root.getChild(1); @@ -99,7 +99,7 @@ var database_check = async function() { root.containerOpen = false; // BOOKMARKS TOOLBAR - root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root; + root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.toolbarGuid).root; Assert.equal(root.childCount, 3); // For now some promises are resolved later, so we can't guarantee an order. @@ -123,7 +123,7 @@ var database_check = async function() { root.containerOpen = false; // UNFILED BOOKMARKS - root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; + root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid).root; Assert.equal(root.childCount, 1); root.containerOpen = false; diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js b/toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js index 3dec1e29bb18..f6107ac5a4a2 100644 --- a/toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js +++ b/toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js @@ -13,7 +13,7 @@ add_task(async function test_bookmarks_html_singleframe() { let bookmarksFile = OS.Path.join(do_get_cwd().path, "bookmarks_html_singleframe.html"); await BookmarkHTMLUtils.importFromFile(bookmarksFile, { replace: true }); - let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root; + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks.menuGuid).root; Assert.equal(root.childCount, 1); let folder = root.getChild(0); PlacesUtils.asContainer(folder).containerOpen = true; diff --git a/toolkit/components/places/tests/unit/test_bookmarks_json.js b/toolkit/components/places/tests/unit/test_bookmarks_json.js index f085ef5405db..60e9b9ed34f7 100644 --- a/toolkit/components/places/tests/unit/test_bookmarks_json.js +++ b/toolkit/components/places/tests/unit/test_bookmarks_json.js @@ -138,21 +138,7 @@ async function testImportedBookmarks() { for (let group in test_bookmarks) { info("[testImportedBookmarks()] Checking group '" + group + "'"); - let root; - switch (group) { - case "menu": - root = - PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root; - break; - case "toolbar": - root = - PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root; - break; - case "unfiled": - root = - PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root; - break; - } + let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarks[`${group}Guid`]).root; let items = test_bookmarks[group]; Assert.equal(root.childCount, items.length); diff --git a/toolkit/components/places/tests/unit/test_broken_folderShortcut_result.js b/toolkit/components/places/tests/unit/test_broken_folderShortcut_result.js index 2d27a867049a..d14a71122b54 100644 --- a/toolkit/components/places/tests/unit/test_broken_folderShortcut_result.js +++ b/toolkit/components/places/tests/unit/test_broken_folderShortcut_result.js @@ -8,10 +8,10 @@ add_task(async function test_brokenFolderShortcut() { url: "http://1.moz.org/", title: "Bookmark 1", }, { - url: "place:folder=1234", + url: "place:parent=1234", title: "Shortcut 1", }, { - url: "place:folder=-1", + url: "place:parent=-1", title: "Shortcut 2", }, { url: "http://2.moz.org/", @@ -24,7 +24,7 @@ add_task(async function test_brokenFolderShortcut() { // Query containing a broken folder shortcuts among results. let query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.unfiledBookmarksFolderId], 1); + query.setParents([PlacesUtils.bookmarks.unfiledGuid], 1); let options = PlacesUtils.history.getNewQueryOptions(); let root = PlacesUtils.history.executeQuery(query, options).root; root.containerOpen = true; @@ -32,7 +32,7 @@ add_task(async function test_brokenFolderShortcut() { Assert.equal(root.childCount, 4); let shortcut = root.getChild(1); - Assert.equal(shortcut.uri, "place:folder=1234"); + Assert.equal(shortcut.uri, "place:parent=1234"); PlacesUtils.asContainer(shortcut); shortcut.containerOpen = true; Assert.equal(shortcut.childCount, 0); @@ -42,7 +42,7 @@ add_task(async function test_brokenFolderShortcut() { Assert.equal(root.childCount, 3); shortcut = root.getChild(1); - Assert.equal(shortcut.uri, "place:folder=-1"); + Assert.equal(shortcut.uri, "place:parent=-1"); PlacesUtils.asContainer(shortcut); shortcut.containerOpen = true; Assert.equal(shortcut.childCount, 0); @@ -55,7 +55,7 @@ add_task(async function test_brokenFolderShortcut() { // Broken folder shortcut as root node. query = PlacesUtils.history.getNewQuery(); - query.setFolders([1234], 1); + query.setParents([1234], 1); options = PlacesUtils.history.getNewQueryOptions(); root = PlacesUtils.history.executeQuery(query, options).root; root.containerOpen = true; @@ -64,7 +64,7 @@ add_task(async function test_brokenFolderShortcut() { // Broken folder shortcut as root node with folder=-1. query = PlacesUtils.history.getNewQuery(); - query.setFolders([-1], 1); + query.setParents([-1], 1); options = PlacesUtils.history.getNewQueryOptions(); root = PlacesUtils.history.executeQuery(query, options).root; root.containerOpen = true; diff --git a/toolkit/components/places/tests/unit/test_browserhistory.js b/toolkit/components/places/tests/unit/test_browserhistory.js index c8661136fba8..3351f29b9aa3 100644 --- a/toolkit/components/places/tests/unit/test_browserhistory.js +++ b/toolkit/components/places/tests/unit/test_browserhistory.js @@ -51,7 +51,7 @@ add_task(async function test_removePages() { Assert.ok(await checkEmptyHistory(), "History is empty"); // Check that the bookmark and its annotation still exist. - let folder = await PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId); + let folder = await PlacesUtils.getFolderContents(PlacesUtils.bookmarks.unfiledGuid); Assert.equal(folder.root.childCount, 1); Assert.equal(PlacesUtils.annotations.getPageAnnotation(pages[BOOKMARK_INDEX], ANNO_NAME), ANNO_VALUE); diff --git a/toolkit/components/places/tests/unit/test_getChildIndex.js b/toolkit/components/places/tests/unit/test_getChildIndex.js index 534e4e8b419b..93de4c75bd33 100644 --- a/toolkit/components/places/tests/unit/test_getChildIndex.js +++ b/toolkit/components/places/tests/unit/test_getChildIndex.js @@ -24,14 +24,14 @@ add_task(async function test_get_child_index() { }); // Get the unfiled bookmark node. - let unfiledNode = getNodeAt(PlacesUtils.unfiledBookmarksFolderId, 0); + let unfiledNode = getNodeAt(PlacesUtils.bookmarks.unfiledGuid, 0); if (!unfiledNode) do_throw("Unable to find bookmark in hierarchy!"); Assert.equal(unfiledNode.title, "Unfiled bookmark"); let hs = PlacesUtils.history; let query = hs.getNewQuery(); - query.setFolders([PlacesUtils.bookmarksMenuFolderId], 1); + query.setParents([PlacesUtils.bookmarks.menuGuid], 1); let options = hs.getNewQueryOptions(); options.queryType = options.QUERY_TYPE_BOOKMARKS; let root = hs.executeQuery(query, options).root; @@ -55,10 +55,10 @@ add_task(async function test_get_child_index() { root.containerOpen = false; }); -function getNodeAt(aFolderId, aIndex) { +function getNodeAt(aFolderGuid, aIndex) { let hs = PlacesUtils.history; let query = hs.getNewQuery(); - query.setFolders([aFolderId], 1); + query.setParents([aFolderGuid], 1); let options = hs.getNewQueryOptions(); options.queryType = options.QUERY_TYPE_BOOKMARKS; let root = hs.executeQuery(query, options).root; diff --git a/toolkit/components/places/tests/unit/test_history_clear.js b/toolkit/components/places/tests/unit/test_history_clear.js index 3818a81d01be..5300ffd89848 100644 --- a/toolkit/components/places/tests/unit/test_history_clear.js +++ b/toolkit/components/places/tests/unit/test_history_clear.js @@ -25,7 +25,7 @@ add_task(async function test_history_clear() { // add a place: bookmark await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid, - url: "place:folder=4", + url: `place:parent=${PlacesUtils.bookmarks.tagsGuid}`, title: "shortcut" }); diff --git a/toolkit/components/places/tests/unit/test_history_sidebar.js b/toolkit/components/places/tests/unit/test_history_sidebar.js index bd5fd959e3bb..0e3292b90b08 100644 --- a/toolkit/components/places/tests/unit/test_history_sidebar.js +++ b/toolkit/components/places/tests/unit/test_history_sidebar.js @@ -399,7 +399,7 @@ async function task_test_date_liveupdate(aResultType) { // Query toolbar and open our query container, then check again liveupdate. options = hs.getNewQueryOptions(); query = hs.getNewQuery(); - query.setFolders([PlacesUtils.toolbarFolderId], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); result = hs.executeQuery(query, options); root = result.root; root.containerOpen = true; diff --git a/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js b/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js index 63cfa15c130e..6f523867bcf2 100644 --- a/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js +++ b/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js @@ -135,7 +135,7 @@ add_task(async function check_history_query() { add_task(async function check_bookmarks_query() { let options = PlacesUtils.history.getNewQueryOptions(); let query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.bookmarksMenuFolderId], 1); + query.setParents([PlacesUtils.bookmarks.menuGuid], 1); let result = PlacesUtils.history.executeQuery(query, options); result.addObserver(resultObserver); let root = result.root; diff --git a/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js b/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js index 5398b515ed59..7c9d8abee5a0 100644 --- a/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js +++ b/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js @@ -30,9 +30,7 @@ add_task(async function test_addBookmarksAndCheckGuids() { }] }); - let folderId = await PlacesUtils.promiseItemId(bookmarks[0].guid); - - let root = PlacesUtils.getFolderContents(folderId).root; + let root = PlacesUtils.getFolderContents(bookmarks[0].guid).root; Assert.equal(root.childCount, 5); // check bookmark guids @@ -85,9 +83,7 @@ add_task(async function test_updateBookmarksAndCheckGuids() { }] }); - let folderId = await PlacesUtils.promiseItemId(bookmarks[0].guid); - - let root = PlacesUtils.getFolderContents(folderId).root; + let root = PlacesUtils.getFolderContents(bookmarks[0].guid).root; Assert.equal(root.childCount, 2); // ensure the bookmark and page guids remain the same after modifing other property. @@ -198,9 +194,7 @@ add_task(async function test_addItemsWithGUIDs() { }] }); - let folderId = await PlacesUtils.promiseItemId(bookmarks[0].guid); - - let root = PlacesUtils.getFolderContents(folderId).root; + let root = PlacesUtils.getFolderContents(bookmarks[0].guid).root; Assert.equal(root.childCount, 2); Assert.equal(root.bookmarkGuid, FOLDER_GUID); Assert.equal(root.getChild(0).bookmarkGuid, BOOKMARK_GUID); diff --git a/toolkit/components/places/tests/unit/test_placeURIs.js b/toolkit/components/places/tests/unit/test_placeURIs.js index aa37b13d6a28..1c127d3fd954 100644 --- a/toolkit/components/places/tests/unit/test_placeURIs.js +++ b/toolkit/components/places/tests/unit/test_placeURIs.js @@ -10,16 +10,15 @@ function run_test() { // Bug 376798 let query = PlacesUtils.history.getNewQuery(); let options = PlacesUtils.history.getNewQueryOptions(); - query.setFolders([PlacesUtils.bookmarks.placesRoot], 1); + query.setParents([PlacesUtils.bookmarks.rootGuid], 1); Assert.equal(PlacesUtils.history.queryToQueryString(query, options), - "place:folder=PLACES_ROOT"); + `place:parent=${PlacesUtils.bookmarks.rootGuid}`); // Bug 378828 options.sortingAnnotation = "test anno"; options.sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_DESCENDING; var placeURI = - "place:folder=PLACES_ROOT&sort=" + Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_DESCENDING + - "&sortingAnnotation=test%20anno"; + `place:parent=${PlacesUtils.bookmarks.rootGuid}&sort=${Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_DESCENDING}&sortingAnnotation=test%20anno`; Assert.equal(PlacesUtils.history.queryToQueryString(query, options), placeURI); options = {}; PlacesUtils.history.queryStringToQuery(placeURI, {}, options); diff --git a/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js b/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js index af637b851aee..da5c09c46746 100644 --- a/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js +++ b/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js @@ -189,12 +189,10 @@ async function test_promiseBookmarksTreeForEachNode(aNode, aOptions, aExcludedGu return item; } -async function test_promiseBookmarksTreeAgainstResult(aItemGuid = "", +async function test_promiseBookmarksTreeAgainstResult(aItemGuid = PlacesUtils.bookmarks.rootGuid, aOptions = { includeItemIds: true }, aExcludedGuids) { - let itemId = aItemGuid ? - await PlacesUtils.promiseItemId(aItemGuid) : PlacesUtils.placesRootId; - let node = PlacesUtils.getFolderContents(itemId).root; + let node = PlacesUtils.getFolderContents(aItemGuid).root; return test_promiseBookmarksTreeForEachNode(node, aOptions, aExcludedGuids); } diff --git a/toolkit/components/places/tests/unit/test_result_sort.js b/toolkit/components/places/tests/unit/test_result_sort.js index 1f6841cbfc97..def2f5ef65e1 100644 --- a/toolkit/components/places/tests/unit/test_result_sort.js +++ b/toolkit/components/places/tests/unit/test_result_sort.js @@ -46,14 +46,12 @@ add_task(async function test() { }] }); - let testFolderId = await PlacesUtils.promiseItemId(bookmarks[0].guid); - let guid1 = bookmarks[1].guid; let guid2 = bookmarks[2].guid; let guid3 = bookmarks[3].guid; // query with natural order - let result = PlacesUtils.getFolderContents(testFolderId); + let result = PlacesUtils.getFolderContents(bookmarks[0].guid); let root = result.root; Assert.equal(root.childCount, 3); diff --git a/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js b/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js index 0d0210068dc0..0924aeb7fa8d 100644 --- a/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js +++ b/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js @@ -75,9 +75,7 @@ add_task(async function test_bookmarkFields() { }], }); - let folderId = await PlacesUtils.promiseItemId(bookmarks[0].guid); - - let root = PlacesUtils.getFolderContents(folderId).root; + let root = PlacesUtils.getFolderContents(bookmarks[0].guid).root; equal(root.childCount, 1); equal(root.visitType, 0, "Visit type should be 0"); diff --git a/toolkit/components/places/tests/unit/test_tagging.js b/toolkit/components/places/tests/unit/test_tagging.js index 65f711f67d83..b1df58b13224 100644 --- a/toolkit/components/places/tests/unit/test_tagging.js +++ b/toolkit/components/places/tests/unit/test_tagging.js @@ -13,7 +13,7 @@ function run_test() { var options = PlacesUtils.history.getNewQueryOptions(); var query = PlacesUtils.history.getNewQuery(); - query.setFolders([PlacesUtils.tagsFolderId], 1); + query.setParents([PlacesUtils.bookmarks.tagsGuid], 1); var result = PlacesUtils.history.executeQuery(query, options); var tagRoot = result.root; tagRoot.containerOpen = true; diff --git a/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js b/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js index 725298eac975..8557ad638fc7 100644 --- a/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js +++ b/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js @@ -35,7 +35,7 @@ add_task(async function test_getURLsForContainerNode_folder() { }); var query = hs.getNewQuery(); - query.setFolders([PlacesUtils.toolbarFolderId], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); var options = hs.getNewQueryOptions(); info("Check folder without uri nodes"); @@ -75,7 +75,7 @@ add_task(async function test_getURLsForContainerNode_folder_excludeItems() { }); var query = hs.getNewQuery(); - query.setFolders([PlacesUtils.toolbarFolderId], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); var options = hs.getNewQueryOptions(); options.excludeItems = true; @@ -100,7 +100,7 @@ add_task(async function test_getURLsForContainerNode_query() { await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid, title: "inside query", - url: "place:folder=BOOKMARKS_MENU&sort=1", + url: `place:parent=${PlacesUtils.bookmarks.menuGuid}&sort=1`, }); // Create a folder and a query node inside it, these should not be considered @@ -118,7 +118,7 @@ add_task(async function test_getURLsForContainerNode_query() { }); var query = hs.getNewQuery(); - query.setFolders([PlacesUtils.toolbarFolderId], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); var options = hs.getNewQueryOptions(); info("Check query without uri nodes"); @@ -142,7 +142,7 @@ add_task(async function test_getURLsForContainerNode_query_excludeItems() { await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid, title: "inside query", - url: "place:folder=BOOKMARKS_MENU&sort=1", + url: `place:parent=${PlacesUtils.bookmarks.menuGuid}&sort=1`, }); // Create a folder and a query node inside it, these should not be considered @@ -160,7 +160,7 @@ add_task(async function test_getURLsForContainerNode_query_excludeItems() { }); var query = hs.getNewQuery(); - query.setFolders([PlacesUtils.toolbarFolderId], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); var options = hs.getNewQueryOptions(); options.excludeItems = true; @@ -185,7 +185,7 @@ add_task(async function test_getURLsForContainerNode_query_excludeQueries() { await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid, title: "inside query", - url: "place:folder=BOOKMARKS_MENU&sort=1", + url: `place:parent=${PlacesUtils.bookmarks.menuGuid}&sort=1`, }); // Create a folder and a query node inside it, these should not be considered @@ -203,7 +203,7 @@ add_task(async function test_getURLsForContainerNode_query_excludeQueries() { }); var query = hs.getNewQuery(); - query.setFolders([PlacesUtils.toolbarFolderId], 1); + query.setParents([PlacesUtils.bookmarks.toolbarGuid], 1); var options = hs.getNewQueryOptions(); options.expandQueries = false; diff --git a/toolkit/components/places/tests/unit/xpcshell.ini b/toolkit/components/places/tests/unit/xpcshell.ini index e6fb448b5175..2b5f70ed70f3 100644 --- a/toolkit/components/places/tests/unit/xpcshell.ini +++ b/toolkit/components/places/tests/unit/xpcshell.ini @@ -20,8 +20,6 @@ support-files = [test_331487.js] [test_384370.js] [test_385397.js] -[test_399264_query_to_string.js] -[test_399264_string_to_query.js] [test_399266.js] # Bug 821781: test fails intermittently on Linux skip-if = os == "linux"