commit 6136e2ffd1df61f4a73e9c297befb5845cbf5996
parent ab9b2328d7f8debf95a5b5635574cd1b08eecc4a
Author: James Teow <jteow@mozilla.com>
Date: Thu, 18 Dec 2025 16:42:28 +0000
Bug 510459 - Fix test_savedsearches.js - r=places-reviewers,mak
Differential Revision: https://phabricator.services.mozilla.com/D276941
Diffstat:
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/toolkit/components/places/tests/bookmarks/test_savedsearches.js b/toolkit/components/places/tests/bookmarks/test_savedsearches.js
@@ -94,15 +94,17 @@ add_task(async function test_savedsearches_bookmarks() {
var item = node.getChild(0);
Assert.equal(item.bookmarkGuid, bookmark.guid);
- // XXX - FAILING - test live-update of query results - add a bookmark that matches the query
- // var tmpBmId = PlacesUtils.bookmarks.insertBookmark(
- // root, uri("http://" + searchTerm + ".com"),
- // PlacesUtils.bookmarks.DEFAULT_INDEX, searchTerm + "blah");
- // do_check_eq(query.childCount, 2);
-
- // XXX - test live-update of query results - delete a bookmark that matches the query
- // PlacesUtils.bookmarks.removeItem(tmpBMId);
- // do_check_eq(query.childCount, 1);
+ // test live-update of query results - add a bookmark that matches the query
+ let newBookmark = await PlacesUtils.bookmarks.insert({
+ parentGuid: PlacesUtils.bookmarks.menuGuid,
+ title: searchTerm + "blah",
+ url: "http://" + searchTerm + ".com",
+ });
+ Assert.equal(node.childCount, 2);
+
+ // test live-update of query results - delete a bookmark that matches the query
+ await PlacesUtils.bookmarks.remove(newBookmark);
+ Assert.equal(node.childCount, 1);
// test live-update of query results - add a folder that matches the query
await PlacesUtils.bookmarks.insert({