michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function run_test() michael@0: { michael@0: const ROOTS = [ michael@0: PlacesUtils.bookmarksMenuFolderId, michael@0: PlacesUtils.toolbarFolderId, michael@0: PlacesUtils.unfiledBookmarksFolderId, michael@0: PlacesUtils.tagsFolderId, michael@0: PlacesUtils.placesRootId michael@0: ]; michael@0: michael@0: for (let root of ROOTS) { michael@0: do_check_true(PlacesUtils.isRootItem(root)); michael@0: michael@0: try { michael@0: PlacesUtils.bookmarks.removeItem(root); michael@0: do_throw("Trying to remove a root should throw"); michael@0: } catch (ex) {} michael@0: michael@0: try { michael@0: PlacesUtils.bookmarks.moveItem(root, PlacesUtils.placesRootId, 0); michael@0: do_throw("Trying to move a root should throw"); michael@0: } catch (ex) {} michael@0: michael@0: try { michael@0: PlacesUtils.bookmarks.removeFolderChildren(root); michael@0: if (root == PlacesUtils.placesRootId) michael@0: do_throw("Trying to remove children of the main root should throw"); michael@0: } catch (ex) { michael@0: if (root != PlacesUtils.placesRootId) michael@0: do_throw("Trying to remove children of other roots should not throw"); michael@0: } michael@0: } michael@0: }