summaryrefslogtreecommitdiffstats
path: root/toolkit/components/places/tests/unit/test_1085291.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /toolkit/components/places/tests/unit/test_1085291.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'toolkit/components/places/tests/unit/test_1085291.js')
-rw-r--r--toolkit/components/places/tests/unit/test_1085291.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/toolkit/components/places/tests/unit/test_1085291.js b/toolkit/components/places/tests/unit/test_1085291.js
new file mode 100644
index 000000000..3159ff8bc
--- /dev/null
+++ b/toolkit/components/places/tests/unit/test_1085291.js
@@ -0,0 +1,42 @@
+add_task(function* () {
+ // test that nodes inserted by incremental update for bookmarks of all types
+ // have the extra bookmark properties (bookmarkGuid, dateAdded, lastModified).
+
+ // getFolderContents opens the root node.
+ let root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root;
+
+ function* insertAndTest(bmInfo) {
+ bmInfo = yield PlacesUtils.bookmarks.insert(bmInfo);
+ let node = root.getChild(root.childCount - 1);
+ Assert.equal(node.bookmarkGuid, bmInfo.guid);
+ Assert.equal(node.dateAdded, bmInfo.dateAdded * 1000);
+ Assert.equal(node.lastModified, bmInfo.lastModified * 1000);
+ }
+
+ // Normal bookmark.
+ yield insertAndTest({ parentGuid: root.bookmarkGuid
+ , type: PlacesUtils.bookmarks.TYPE_BOOKMARK
+ , title: "Test Bookmark"
+ , url: "http://test.url.tld" });
+
+ // place: query
+ yield insertAndTest({ parentGuid: root.bookmarkGuid
+ , type: PlacesUtils.bookmarks.TYPE_BOOKMARK
+ , title: "Test Query"
+ , url: "place:folder=BOOKMARKS_MENU" });
+
+ // folder
+ yield insertAndTest({ parentGuid: root.bookmarkGuid
+ , type: PlacesUtils.bookmarks.TYPE_FOLDER
+ , title: "Test Folder" });
+
+ // separator
+ yield insertAndTest({ parentGuid: root.bookmarkGuid
+ , type: PlacesUtils.bookmarks.TYPE_SEPARATOR });
+
+ root.containerOpen = false;
+});
+
+function run_test() {
+ run_next_test();
+}