summaryrefslogtreecommitdiffstats
path: root/toolkit/components/places/tests/queries/test_queryMultipleFolder.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-25 15:07:00 -0500
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 12:55:19 +0200
commiteb70e6e3d0bff11c25f14b1196025791bf2308fb (patch)
tree5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/components/places/tests/queries/test_queryMultipleFolder.js
parent32ead795290b3399d56b4708fc75b77d296f6a1a (diff)
downloadUXP-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/queries/test_queryMultipleFolder.js')
-rw-r--r--toolkit/components/places/tests/queries/test_queryMultipleFolder.js65
1 files changed, 0 insertions, 65 deletions
diff --git a/toolkit/components/places/tests/queries/test_queryMultipleFolder.js b/toolkit/components/places/tests/queries/test_queryMultipleFolder.js
deleted file mode 100644
index 694728a43..000000000
--- a/toolkit/components/places/tests/queries/test_queryMultipleFolder.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_queryMultipleFolders() {
- // adding bookmarks in the folders
- let folderIds = [];
- let bookmarkIds = [];
- for (let i = 0; i < 3; ++i) {
- let folder = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: `Folder${i}`
- });
- folderIds.push(yield PlacesUtils.promiseItemId(folder.guid));
-
- for (let j = 0; j < 7; ++j) {
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: (yield PlacesUtils.promiseItemGuid(folderIds[i])),
- url: `http://Bookmark${i}_${j}.com`,
- title: ""
- });
- bookmarkIds.push(yield PlacesUtils.promiseItemId(bm.guid));
- }
- }
-
- // using queryStringToQueries
- let query = {};
- let options = {};
- let maxResults = 20;
- let queryString = "place:" + folderIds.map((id) => {
- return "folder=" + id;
- }).join('&') + "&sort=5&maxResults=" + maxResults;
- PlacesUtils.history.queryStringToQueries(queryString, query, {}, options);
- let rootNode = PlacesUtils.history.executeQuery(query.value[0], options.value).root;
- rootNode.containerOpen = true;
- let resultLength = rootNode.childCount;
- Assert.equal(resultLength, maxResults);
- for (let i = 0; i < resultLength; ++i) {
- let node = rootNode.getChild(i);
- Assert.equal(bookmarkIds[i], node.itemId, node.uri);
- }
- rootNode.containerOpen = false;
-
- // using getNewQuery and getNewQueryOptions
- query = PlacesUtils.history.getNewQuery();
- options = PlacesUtils.history.getNewQueryOptions();
- query.setFolders(folderIds, folderIds.length);
- options.sortingMode = options.SORT_BY_URI_ASCENDING;
- options.maxResults = maxResults;
- rootNode = PlacesUtils.history.executeQuery(query, options).root;
- rootNode.containerOpen = true;
- resultLength = rootNode.childCount;
- Assert.equal(resultLength, maxResults);
- for (let i = 0; i < resultLength; ++i) {
- let node = rootNode.getChild(i);
- Assert.equal(bookmarkIds[i], node.itemId, node.uri);
- }
- rootNode.containerOpen = false;
-});