toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim:set ts=2 sw=2 sts=2 et: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 // Test for bug #801450
     9 // Get Services
    10 Cu.import("resource://gre/modules/BookmarkHTMLUtils.jsm");
    12 function run_test()
    13 {
    14   run_next_test();
    15 }
    17 add_task(function test_bookmarks_html_singleframe()
    18 {
    19   let bookmarksFile = OS.Path.join(do_get_cwd().path, "bookmarks_html_singleframe.html");
    20   yield BookmarkHTMLUtils.importFromFile(bookmarksFile, true);
    22   let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root;
    23   do_check_eq(root.childCount, 1);
    24   let folder = root.getChild(0);
    25   PlacesUtils.asContainer(folder).containerOpen = true;
    26   do_check_eq(folder.title, "Subtitle");
    27   do_check_eq(folder.childCount, 1);
    28   let bookmark = folder.getChild(0);
    29   do_check_eq(bookmark.uri, "http://www.mozilla.org/");
    30   do_check_eq(bookmark.title, "Mozilla");
    31   folder.containerOpen = false;
    32 });

mercurial