michael@0: /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: michael@0: - add a folder michael@0: - add a folder-shortcut to the new folder michael@0: - query for the shortcut michael@0: - remove the folder-shortcut michael@0: - confirm the shortcut is removed from the query results michael@0: michael@0: */ michael@0: michael@0: function run_test() { michael@0: const IDX = PlacesUtils.bookmarks.DEFAULT_INDEX; michael@0: var folderId = michael@0: PlacesUtils.bookmarks.createFolder(PlacesUtils.toolbarFolderId, "", IDX); michael@0: michael@0: var queryId = michael@0: PlacesUtils.bookmarks.insertBookmark(PlacesUtils.toolbarFolderId, michael@0: uri("place:folder=" + folderId), IDX, ""); michael@0: michael@0: var root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId, false, true).root; michael@0: michael@0: var oldCount = root.childCount; michael@0: michael@0: PlacesUtils.bookmarks.removeItem(queryId); michael@0: michael@0: do_check_eq(root.childCount, oldCount-1); michael@0: michael@0: root.containerOpen = false; michael@0: }