diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:55:19 +0200 |
commit | eb70e6e3d0bff11c25f14b1196025791bf2308fb (patch) | |
tree | 5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/components/places/tests/unit/test_PlacesUtils_asyncGetBookmarkIds.js | |
parent | 32ead795290b3399d56b4708fc75b77d296f6a1a (diff) | |
download | UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.gz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.lz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.xz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.zip |
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/components/places/tests/unit/test_PlacesUtils_asyncGetBookmarkIds.js')
-rw-r--r-- | toolkit/components/places/tests/unit/test_PlacesUtils_asyncGetBookmarkIds.js | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/toolkit/components/places/tests/unit/test_PlacesUtils_asyncGetBookmarkIds.js b/toolkit/components/places/tests/unit/test_PlacesUtils_asyncGetBookmarkIds.js deleted file mode 100644 index 182f75eac..000000000 --- a/toolkit/components/places/tests/unit/test_PlacesUtils_asyncGetBookmarkIds.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * This file tests PlacesUtils.asyncGetBookmarkIds method. - */ - -const TEST_URL = "http://www.example.com/"; - -var promiseAsyncGetBookmarkIds = Task.async(function* (url) { - yield PlacesTestUtils.promiseAsyncUpdates(); - return new Promise(resolve => { - PlacesUtils.asyncGetBookmarkIds(url, (itemIds, uri) => { - Assert.equal(uri, url); - resolve({ itemIds, url }); - }); - }); -}); - -add_task(function* test_no_bookmark() { - let { itemIds, url } = yield promiseAsyncGetBookmarkIds(TEST_URL); - Assert.equal(itemIds.length, 0); - Assert.equal(url, TEST_URL); -}); - -add_task(function* test_one_bookmark() { - let bookmark = yield PlacesUtils.bookmarks.insert({ - parentGuid: PlacesUtils.bookmarks.unfiledGuid, - url: TEST_URL, - title: "test" - }); - let itemId = yield PlacesUtils.promiseItemId(bookmark.guid); - { - let { itemIds, url } = yield promiseAsyncGetBookmarkIds(NetUtil.newURI(TEST_URL)); - Assert.equal(itemIds.length, 1); - Assert.equal(itemIds[0], itemId); - Assert.equal(url.spec, TEST_URL); - } - { - let { itemIds, url } = yield promiseAsyncGetBookmarkIds(TEST_URL); - Assert.equal(itemIds.length, 1); - Assert.equal(itemIds[0], itemId); - Assert.equal(url, TEST_URL); - } - yield PlacesUtils.bookmarks.remove(bookmark); -}); - -add_task(function* test_multiple_bookmarks() { - let ids = []; - let bookmark1 = yield PlacesUtils.bookmarks.insert({ - parentGuid: PlacesUtils.bookmarks.unfiledGuid, - url: TEST_URL, - title: "test" - }); - ids.push((yield PlacesUtils.promiseItemId(bookmark1.guid))); - let bookmark2 = yield PlacesUtils.bookmarks.insert({ - parentGuid: PlacesUtils.bookmarks.unfiledGuid, - url: TEST_URL, - title: "test" - }); - ids.push((yield PlacesUtils.promiseItemId(bookmark2.guid))); - - let { itemIds, url } = yield promiseAsyncGetBookmarkIds(TEST_URL); - Assert.deepEqual(ids, itemIds); - Assert.equal(url, TEST_URL); - - yield PlacesUtils.bookmarks.remove(bookmark1); - yield PlacesUtils.bookmarks.remove(bookmark2); -}); - -add_task(function* test_cancel() { - let pending = PlacesUtils.asyncGetBookmarkIds(TEST_URL, () => { - Assert.ok(false, "A canceled pending statement should not be invoked"); - }); - pending.cancel(); - - let { itemIds, url } = yield promiseAsyncGetBookmarkIds(TEST_URL); - Assert.equal(itemIds.length, 0); - Assert.equal(url, TEST_URL); -}); |