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: var tests = []; michael@0: michael@0: michael@0: const DEFAULT_INDEX = PlacesUtils.bookmarks.DEFAULT_INDEX; michael@0: michael@0: function run_test() { michael@0: // folder to hold this test michael@0: var folderId = michael@0: PlacesUtils.bookmarks.createFolder(PlacesUtils.toolbarFolderId, michael@0: "", DEFAULT_INDEX); michael@0: michael@0: // add a bookmark to the new folder michael@0: var bookmarkURI = uri("http://iasdjkf"); michael@0: do_check_false(PlacesUtils.bookmarks.isBookmarked(bookmarkURI)); michael@0: var bookmarkId = PlacesUtils.bookmarks.insertBookmark(folderId, bookmarkURI, michael@0: DEFAULT_INDEX, ""); michael@0: do_check_eq(PlacesUtils.bookmarks.getItemTitle(bookmarkId), ""); michael@0: michael@0: // remove the folder using removeItem michael@0: PlacesUtils.bookmarks.removeItem(folderId); michael@0: do_check_eq(PlacesUtils.bookmarks.getBookmarkIdsForURI(bookmarkURI).length, 0); michael@0: do_check_false(PlacesUtils.bookmarks.isBookmarked(bookmarkURI)); michael@0: do_check_eq(PlacesUtils.bookmarks.getItemIndex(bookmarkId), -1); michael@0: }