|
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/. */ |
|
6 |
|
7 // Test for bug #801450 |
|
8 |
|
9 // Get Services |
|
10 Cu.import("resource://gre/modules/BookmarkHTMLUtils.jsm"); |
|
11 |
|
12 function run_test() |
|
13 { |
|
14 run_next_test(); |
|
15 } |
|
16 |
|
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); |
|
21 |
|
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 }); |