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: // Test for bug #801450 michael@0: michael@0: // Get Services michael@0: Cu.import("resource://gre/modules/BookmarkHTMLUtils.jsm"); michael@0: michael@0: function run_test() michael@0: { michael@0: run_next_test(); michael@0: } michael@0: michael@0: add_task(function test_bookmarks_html_singleframe() michael@0: { michael@0: let bookmarksFile = OS.Path.join(do_get_cwd().path, "bookmarks_html_singleframe.html"); michael@0: yield BookmarkHTMLUtils.importFromFile(bookmarksFile, true); michael@0: michael@0: let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root; michael@0: do_check_eq(root.childCount, 1); michael@0: let folder = root.getChild(0); michael@0: PlacesUtils.asContainer(folder).containerOpen = true; michael@0: do_check_eq(folder.title, "Subtitle"); michael@0: do_check_eq(folder.childCount, 1); michael@0: let bookmark = folder.getChild(0); michael@0: do_check_eq(bookmark.uri, "http://www.mozilla.org/"); michael@0: do_check_eq(bookmark.title, "Mozilla"); michael@0: folder.containerOpen = false; michael@0: });