41 var
bmsvc =
Cc[
"@mozilla.org/browser/nav-bookmarks-service;1"].
44 do_throw(
"Could not get Bookmarks service\n");
49 var annosvc =
Cc[
"@mozilla.org/browser/annotation-service;1"].
52 do_throw(
"Could not get Annotation service\n");
57 var gluesvc =
Cc[
"@mozilla.org/browser/browserglue;1"].
60 do_throw(
"Could not get BrowserGlue service\n");
65 var
pref =
Cc[
"@mozilla.org/preferences-service;1"].
68 do_throw(
"Could not get Preferences service\n");
77 pref.setIntPref(
"browser.places.smartBookmarksVersion", -1);
78 gluesvc.ensurePlacesDefaultQueriesInitialized();
82 do_check_eq(
pref.getIntPref(
"browser.places.smartBookmarksVersion"), -1);
85 pref.setIntPref(
"browser.places.smartBookmarksVersion", 0);
86 gluesvc.ensurePlacesDefaultQueriesInitialized();
88 do_check_neq(smartBookmarkItemIds.length, 0);
90 do_check_true(
pref.getIntPref(
"browser.places.smartBookmarksVersion") > 0);
92 var smartBookmarksCount = smartBookmarkItemIds.length;
96 bmsvc.removeItem(smartBookmarkItemIds[0]);
97 pref.setIntPref(
"browser.places.smartBookmarksVersion", 0);
98 gluesvc.ensurePlacesDefaultQueriesInitialized();
100 do_check_eq(smartBookmarkItemIds.length, smartBookmarksCount);
102 do_check_true(
pref.getIntPref(
"browser.places.smartBookmarksVersion") > 0);
106 var parent =
bmsvc.getFolderIdForItem(smartBookmarkItemIds[0]);
107 var oldTitle =
bmsvc.getItemTitle(smartBookmarkItemIds[0]);
109 var newParent =
bmsvc.createFolder(parent,
"test",
bmsvc.DEFAULT_INDEX);
110 bmsvc.moveItem(smartBookmarkItemIds[0], newParent,
bmsvc.DEFAULT_INDEX);
112 bmsvc.setItemTitle(smartBookmarkItemIds[0],
"new title");
114 pref.setIntPref(
"browser.places.smartBookmarksVersion", 0);
115 gluesvc.ensurePlacesDefaultQueriesInitialized();
117 do_check_eq(smartBookmarkItemIds.length, smartBookmarksCount);
121 do_check_true(
pref.getIntPref(
"browser.places.smartBookmarksVersion") > 0);
do_check_eq(typeof PlacesUtils,"object")
const SMART_BOOKMARKS_ANNO
getService(Ci.sbIFaceplateManager)
const SMART_BOOKMARKS_PREF