diff options
author | Moonchild <mcwerewolf@wolfbeast.com> | 2018-12-12 11:01:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-12 11:01:48 +0100 |
commit | bc8a25f5e33700f700b1e07b238bef5dae22f1ad (patch) | |
tree | c1f1ec816f1a85459d05bd6a4cf4f6170b01c602 /services/sync/tests/unit/test_bookmark_livemarks.js | |
parent | f2d4bd1e395f903355cc157a1de7207e5b22b7fb (diff) | |
parent | 9697bfa68f32984b196748e388d743dddbe6aa7b (diff) | |
download | UXP-bc8a25f5e33700f700b1e07b238bef5dae22f1ad.tar UXP-bc8a25f5e33700f700b1e07b238bef5dae22f1ad.tar.gz UXP-bc8a25f5e33700f700b1e07b238bef5dae22f1ad.tar.lz UXP-bc8a25f5e33700f700b1e07b238bef5dae22f1ad.tar.xz UXP-bc8a25f5e33700f700b1e07b238bef5dae22f1ad.zip |
Merge pull request #898 from MoonchildProductions/Sync-weave
Remove FxA Phase 1
Diffstat (limited to 'services/sync/tests/unit/test_bookmark_livemarks.js')
-rw-r--r-- | services/sync/tests/unit/test_bookmark_livemarks.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/services/sync/tests/unit/test_bookmark_livemarks.js b/services/sync/tests/unit/test_bookmark_livemarks.js index 8adde76d8..d7cda091b 100644 --- a/services/sync/tests/unit/test_bookmark_livemarks.js +++ b/services/sync/tests/unit/test_bookmark_livemarks.js @@ -12,11 +12,11 @@ Cu.import("resource://testing-common/services/common/utils.js"); const DESCRIPTION_ANNO = "bookmarkProperties/description"; -var engine = Service.engineManager.get("bookmarks"); -var store = engine._store; +let engine = Service.engineManager.get("bookmarks"); +let store = engine._store; // Record borrowed from Bug 631361. -var record631361 = { +let record631361 = { id: "M5bwUKK8hPyF", index: 150, modified: 1296768176.49, @@ -103,11 +103,20 @@ add_test(function test_livemark_descriptions() { add_test(function test_livemark_invalid() { _("Livemarks considered invalid by nsLivemarkService are skipped."); + _("Parent is 0, which is invalid. Will be set to unfiled."); + let noParentRec = makeLivemark(record631361.payload, true); + noParentRec._parent = 0; + store.create(noParentRec); + let recID = store.idForGUID(noParentRec.id, true); + do_check_true(recID > 0); + do_check_eq(PlacesUtils.bookmarks.getFolderIdForItem(recID), PlacesUtils.bookmarks.unfiledBookmarksFolder); + _("Parent is unknown. Will be set to unfiled."); let lateParentRec = makeLivemark(record631361.payload, true); let parentGUID = Utils.makeGUID(); lateParentRec.parentid = parentGUID; - do_check_eq(-1, store.idForGUID(parentGUID)); + lateParentRec._parent = store.idForGUID(parentGUID); // Usually done by applyIncoming. + do_check_eq(-1, lateParentRec._parent); store.create(lateParentRec); recID = store.idForGUID(lateParentRec.id, true); @@ -124,7 +133,7 @@ add_test(function test_livemark_invalid() { _("Parent is a Livemark. Will be skipped."); let lmParentRec = makeLivemark(record631361.payload, true); - lmParentRec.parentid = store.GUIDForId(recID); + lmParentRec._parent = recID; store.create(lmParentRec); // No exception, but no creation occurs. do_check_eq(-1, store.idForGUID(lmParentRec.id, true)); |