--- a/toolkit/components/places/tests/bookmarks/test_1016953-renaming-uncompressed.js
+++ b/toolkit/components/places/tests/bookmarks/test_1016953-renaming-uncompressed.js
@@ -1,12 +1,8 @@
-function run_test() {
- run_next_test();
-}
-
/* Bug 1016953 - When a previous bookmark backup exists with the same hash
regardless of date, an automatic backup should attempt to either rename it to
today's date if the backup was for an old date or leave it alone if it was for
the same date. However if the file ext was json it will accidentally rename it
to jsonlz4 while keeping the json contents
*/
add_task(async function test_same_date_same_hash() {
--- a/toolkit/components/places/tests/bookmarks/test_1017502-bookmarks_foreign_count.js
+++ b/toolkit/components/places/tests/bookmarks/test_1017502-bookmarks_foreign_count.js
@@ -15,20 +15,16 @@ async function getForeignCountForURL(con
await PlacesTestUtils.promiseAsyncUpdates();
url = url instanceof Ci.nsIURI ? url.spec : url;
let rows = await conn.executeCached(
`SELECT foreign_count FROM moz_places WHERE url_hash = hash(:t_url)
AND url = :t_url`, { t_url: url });
return rows[0].getResultByName("foreign_count");
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function add_remove_change_bookmark_test() {
let conn = await PlacesUtils.promiseDBConnection();
// Simulate a visit to the url
await PlacesTestUtils.addVisits(T_URI);
Assert.equal((await getForeignCountForURL(conn, T_URI)), 0);
// Add 1st bookmark which should increment foreign_count by 1
--- a/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js
+++ b/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js
@@ -1,17 +1,16 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Menu, Toolbar, Unsorted, Tags, Mobile
const PLACES_ROOTS_COUNT = 5;
-var tests = [];
/*
Backup/restore tests example:
var myTest = {
populate: function () { ... add bookmarks ... },
validate: function () { ... query for your bookmarks ... }
--- a/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js
+++ b/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js
@@ -49,20 +49,16 @@ var quotesTest = {
do_check_eq(folderNode.title, this._folderTitle);
// clean up
toolbar.containerOpen = false;
}
}
tests.push(quotesTest);
-function run_test() {
- run_next_test();
-}
-
add_task(async function() {
// make json file
let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.json");
// populate db
tests.forEach(function(aTest) {
aTest.populate();
// sanity
--- a/toolkit/components/places/tests/bookmarks/test_448584.js
+++ b/toolkit/components/places/tests/bookmarks/test_448584.js
@@ -60,20 +60,16 @@ var invalidURITest = {
}
// clean up
toolbar.containerOpen = false;
}
}
tests.push(invalidURITest);
-function run_test() {
- run_next_test();
-}
-
add_task(async function() {
// make json file
let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.json");
// populate db
tests.forEach(function(aTest) {
aTest.populate();
// sanity
--- a/toolkit/components/places/tests/bookmarks/test_458683.js
+++ b/toolkit/components/places/tests/bookmarks/test_458683.js
@@ -1,24 +1,16 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var tests = [];
-// Get database connection
-try {
- var mDBConn = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
- .DBConnection;
-} catch (ex) {
- do_throw("Could not get database connection\n");
-}
-
/*
This test is:
- don't block while doing backup and restore if tag containers contain
bogus items (separators, folders)
*/
var invalidTagChildTest = {
_itemTitle: "invalid uri",
@@ -91,20 +83,16 @@ var invalidTagChildTest = {
// test for our tag
var tags = PlacesUtils.tagging.getTagsForURI(PlacesUtils._uri(this._itemUrl));
do_check_eq(tags.length, 1);
do_check_eq(tags[0], this._tag);
}
}
tests.push(invalidTagChildTest);
-function run_test() {
- run_next_test()
-}
-
add_task(async function() {
let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.json");
// populate db
tests.forEach(function(aTest) {
aTest.populate();
// sanity
aTest.validate();
--- a/toolkit/components/places/tests/bookmarks/test_466303-json-remove-backups.js
+++ b/toolkit/components/places/tests/bookmarks/test_466303-json-remove-backups.js
@@ -113,12 +113,8 @@ add_task(async function check_max_backup
lastBackupPath = aEntry.path;
});
} finally {
iterator.close();
}
do_check_eq(count, 2);
do_check_neq(lastBackupPath, null);
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js
+++ b/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js
@@ -1,20 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Checks that automatically created bookmark backups are discarded if they are
* duplicate of an existing ones.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(async function() {
// Create a backup for yesterday in the backups folder.
let backupFolder = await PlacesBackups.getBackupFolder();
let dateObj = new Date();
dateObj.setDate(dateObj.getDate() - 1);
let oldBackupName = PlacesBackups.getFilenameForDate(dateObj);
let oldBackup = OS.Path.join(backupFolder, oldBackupName);
let {count: count, hash: hash} = await BookmarkJSONUtils.exportToFile(oldBackup);
--- a/toolkit/components/places/tests/bookmarks/test_818587_compress-bookmarks-backups.js
+++ b/toolkit/components/places/tests/bookmarks/test_818587_compress-bookmarks-backups.js
@@ -1,18 +1,14 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-function run_test() {
- run_next_test();
-}
-
add_task(async function compress_bookmark_backups_test() {
// Check for jsonlz4 extension
let todayFilename = PlacesBackups.getFilenameForDate(new Date(2014, 4, 15), true);
do_check_eq(todayFilename, "bookmarks-2014-05-15.jsonlz4");
await PlacesBackups.create();
// Check that a backup for today has been created and the regex works fine for lz4.
--- a/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js
+++ b/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js
@@ -1,20 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* To confirm that metadata i.e. bookmark count is set and retrieved for
* automatic backups.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_saveBookmarksToJSONFile_and_create() {
// Add a bookmark
let uri = NetUtil.newURI("http://getfirefox.com/");
let bookmarkId =
PlacesUtils.bookmarks.insertBookmark(
PlacesUtils.unfiledBookmarksFolderId, uri,
PlacesUtils.bookmarks.DEFAULT_INDEX, "Get Firefox!");
--- a/toolkit/components/places/tests/bookmarks/test_992901-backup-unsorted-hierarchy.js
+++ b/toolkit/components/places/tests/bookmarks/test_992901-backup-unsorted-hierarchy.js
@@ -2,20 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Checks that backups properly include all of the bookmarks if the hierarchy
* in the database is unordered so that a hierarchy is defined before its
* ancestor in the bookmarks table.
*/
-function run_test() {
- run_next_test();
-}
-
add_task(async function() {
let bm = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
NetUtil.newURI("http://mozilla.org/"),
PlacesUtils.bookmarks.DEFAULT_INDEX,
"bookmark");
let f2 = PlacesUtils.bookmarks.createFolder(PlacesUtils.unfiledBookmarksFolderId, "f2",
PlacesUtils.bookmarks.DEFAULT_INDEX);
PlacesUtils.bookmarks.moveItem(bm, f2, PlacesUtils.bookmarks.DEFAULT_INDEX);
--- a/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js
+++ b/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js
@@ -1,20 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Checks that we don't encodeURI twice when creating bookmarks.html.
*/
-
-function run_test() {
- run_next_test();
-}
-
add_task(async function() {
let uri = NetUtil.newURI("http://bt.ktxp.com/search.php?keyword=%E5%A6%84%E6%83%B3%E5%AD%A6%E7%94%9F%E4%BC%9A");
let bm = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
uri,
PlacesUtils.bookmarks.DEFAULT_INDEX,
"bookmark");
let file = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.exported.997030.html");
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks.js
+++ b/toolkit/components/places/tests/bookmarks/test_bookmarks.js
@@ -70,21 +70,16 @@ var bookmarksObserver = {
};
// Get bookmarks menu folder id.
var root = bs.bookmarksMenuFolder;
// Index at which items should begin.
var bmStartIndex = 0;
-
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_bookmarks() {
bs.addObserver(bookmarksObserver);
// test special folders
do_check_true(bs.placesRoot > 0);
do_check_true(bs.bookmarksMenuFolder > 0);
do_check_true(bs.tagsFolder > 0);
do_check_true(bs.toolbarFolder > 0);
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_insert.js
+++ b/toolkit/components/places/tests/bookmarks/test_bookmarks_insert.js
@@ -250,12 +250,8 @@ add_task(async function create_bookmark_
url: "http://example.com/",
title: "a bookmark" });
checkBookmarkObject(bm);
Assert.equal(bm.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
Assert.equal(bm.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
Assert.equal(bm.url.href, "http://example.com/");
Assert.equal(bm.title, "a bookmark");
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js
+++ b/toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js
@@ -516,12 +516,8 @@ function expectNotifications() {
if (name in target)
return target[name];
return undefined;
}
});
PlacesUtils.bookmarks.addObserver(observer);
return observer;
}
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_update.js
+++ b/toolkit/components/places/tests/bookmarks/test_bookmarks_update.js
@@ -387,12 +387,8 @@ add_task(async function update_move_appe
ensurePosition(sep_2, folder_b.guid, 1);
sep_1 = await PlacesUtils.bookmarks.fetch(sep_1.guid);
ensurePosition(sep_1, folder_a.guid, 0);
sep_3 = await PlacesUtils.bookmarks.fetch(sep_3.guid);
ensurePosition(sep_3, folder_b.guid, 0);
sep_2 = await PlacesUtils.bookmarks.fetch(sep_2.guid);
ensurePosition(sep_2, folder_b.guid, 1);
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/places/tests/bookmarks/test_getBookmarkedURIFor.js
+++ b/toolkit/components/places/tests/bookmarks/test_getBookmarkedURIFor.js
@@ -3,23 +3,18 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Test bookmarksService.getBookmarkedURIFor(aURI);
*/
-var hs = PlacesUtils.history;
var bs = PlacesUtils.bookmarks;
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_getBookmarkedURIFor() {
let now = Date.now() * 1000;
const sourceURI = uri("http://test.mozilla.org/");
// Add a visit and a bookmark.
await PlacesTestUtils.addVisits({ uri: sourceURI, visitDate: now });
do_check_eq(bs.getBookmarkedURIFor(sourceURI), null);
let sourceItemId = bs.insertBookmark(bs.unfiledBookmarksFolder,
--- a/toolkit/components/places/tests/bookmarks/test_keywords.js
+++ b/toolkit/components/places/tests/bookmarks/test_keywords.js
@@ -295,12 +295,8 @@ add_task(async function test_addRemoveBo
check_keyword(URI3, null);
// Don't check the foreign count since the process is async.
// The new test_keywords.js in unit is checking this though.
await PlacesTestUtils.promiseAsyncUpdates();
check_orphans();
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/places/tests/bookmarks/test_removeItem.js
+++ b/toolkit/components/places/tests/bookmarks/test_removeItem.js
@@ -1,17 +1,14 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-var tests = [];
-
-
const DEFAULT_INDEX = PlacesUtils.bookmarks.DEFAULT_INDEX;
function run_test() {
// folder to hold this test
var folderId =
PlacesUtils.bookmarks.createFolder(PlacesUtils.toolbarFolderId,
"", DEFAULT_INDEX);
--- a/toolkit/components/places/tests/expiration/test_analyze_runs.js
+++ b/toolkit/components/places/tests/expiration/test_analyze_runs.js
@@ -40,20 +40,16 @@ function do_check_analyze_ran(aTableName
}
} finally {
stmt.finalize();
}
}
// Tests
-function run_test() {
- run_next_test();
-}
-
add_task(async function init_tests() {
const TEST_URI = NetUtil.newURI("http://mozilla.org/");
const TEST_TITLE = "This is a test";
await PlacesUtils.bookmarks.insert({
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
title: TEST_TITLE,
url: TEST_URI
--- a/toolkit/components/places/tests/expiration/test_annos_expire_history.js
+++ b/toolkit/components/places/tests/expiration/test_annos_expire_history.js
@@ -10,20 +10,16 @@
* EXPIRE_WITH_HISTORY annotations should be expired when a page has no more
* visits, even if the page still exists in the database.
* This expiration policy is only valid for page annotations.
*/
var as = Cc["@mozilla.org/browser/annotation-service;1"].
getService(Ci.nsIAnnotationService);
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_annos_expire_history() {
// Set interval to a large value so we don't expire on it.
setInterval(3600); // 1h
// Expire all expirable pages.
setMaxPages(0);
// Add some visited page and a couple expire with history annotations for each.
--- a/toolkit/components/places/tests/expiration/test_annos_expire_never.js
+++ b/toolkit/components/places/tests/expiration/test_annos_expire_never.js
@@ -13,20 +13,16 @@
* expired, namely when the page has no visits and is not bookmarked.
* Otherwise if it's an item annotation the annotation will be expired when
* the item is removed, thus expiration won't handle this case at all.
*/
var as = Cc["@mozilla.org/browser/annotation-service;1"].
getService(Ci.nsIAnnotationService);
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_annos_expire_never() {
// Set interval to a large value so we don't expire on it.
setInterval(3600); // 1h
// Expire all expirable pages.
setMaxPages(0);
// Add some visited page and a couple expire never annotations for each.
--- a/toolkit/components/places/tests/expiration/test_annos_expire_policy.js
+++ b/toolkit/components/places/tests/expiration/test_annos_expire_policy.js
@@ -63,20 +63,16 @@ function add_old_anno(aIdentifier, aName
stmt.params.last_modified = lastModifiedDate;
try {
stmt.executeStep();
} finally {
stmt.finalize();
}
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_annos_expire_policy() {
// Set interval to a large value so we don't expire on it.
setInterval(3600); // 1h
// Expire all expirable pages.
setMaxPages(0);
let now_specific_to_test = getExpirablePRTime();
--- a/toolkit/components/places/tests/expiration/test_annos_expire_session.js
+++ b/toolkit/components/places/tests/expiration/test_annos_expire_session.js
@@ -8,20 +8,16 @@
* What this is aimed to test:
*
* Session annotations should be expired when browsing session ends.
*/
var as = Cc["@mozilla.org/browser/annotation-service;1"].
getService(Ci.nsIAnnotationService);
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_annos_expire_session() {
// Set interval to a large value so we don't expire on it.
setInterval(3600); // 1h
// Add some visited page and a couple session annotations for each.
let now = Date.now() * 1000;
for (let i = 0; i < 10; i++) {
let pageURI = uri("http://session_page_anno." + i + ".mozilla.org/");
--- a/toolkit/components/places/tests/expiration/test_clearHistory.js
+++ b/toolkit/components/places/tests/expiration/test_clearHistory.js
@@ -6,17 +6,16 @@
/**
* What this is aimed to test:
*
* History.clear() should expire everything but bookmarked pages and valid
* annos.
*/
-var hs = PlacesUtils.history;
var as = PlacesUtils.annotations;
/**
* Creates an aged annotation.
*
* @param aIdentifier Either a page url or an item id.
* @param aIdentifier Name of the annotation.
* @param aValue Value for the annotation.
--- a/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js
+++ b/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js
@@ -36,20 +36,16 @@ var tests = [
{ desc: "Add 10 pages, all bookmarked.",
addPages: 10,
addBookmarks: 10,
expectedNotifications: 0, // No expirable pages.
},
];
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_notifications_onDeleteURI() {
// Set interval to a large value so we don't expire on it.
setInterval(3600); // 1h
// Expire anything that is expirable.
setMaxPages(0);
for (let testIndex = 1; testIndex <= tests.length; testIndex++) {
--- a/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js
+++ b/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js
@@ -53,20 +53,16 @@ var tests = [
visitsPerPage: 10,
addBookmarks: 0,
limitExpiration: 10,
expectedNotifications: 10, // Will expire 1 visist for each page, but won't
}, // expire pages since they still have visits.
];
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_notifications_onDeleteVisits() {
// Set interval to a large value so we don't expire on it.
setInterval(3600); // 1h
// Expire anything that is expirable.
setMaxPages(0);
for (let testIndex = 1; testIndex <= tests.length; testIndex++) {
--- a/toolkit/components/places/tests/favicons/test_expireAllFavicons.js
+++ b/toolkit/components/places/tests/favicons/test_expireAllFavicons.js
@@ -28,12 +28,8 @@ add_task(async function test_expireAllFa
let promise = promiseTopicObserved(PlacesUtils.TOPIC_FAVICONS_EXPIRED);
PlacesUtils.favicons.expireAllFavicons();
await promise;
// Check that the favicons for the pages we added were removed.
await promiseFaviconMissingForPage(TEST_PAGE_URI);
await promiseFaviconMissingForPage(BOOKMARKED_PAGE_URI);
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/places/tests/favicons/test_getFaviconDataForPage.js
+++ b/toolkit/components/places/tests/favicons/test_getFaviconDataForPage.js
@@ -1,15 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const FAVICON_URI = NetUtil.newURI(do_get_file("favicon-normal32.png"));
const FAVICON_DATA = readFileData(do_get_file("favicon-normal32.png"));
const FAVICON_MIMETYPE = "image/png";
-const ICON16_URL = "http://places.test/favicon-normal16.png";
const ICON32_URL = "http://places.test/favicon-normal32.png";
add_task(async function test_normal() {
do_check_eq(FAVICON_DATA.length, 344);
let pageURI = NetUtil.newURI("http://example.com/normal");
await PlacesTestUtils.addVisits(pageURI);
await new Promise(resolve => {
--- a/toolkit/components/places/tests/favicons/test_getFaviconURLForPage.js
+++ b/toolkit/components/places/tests/favicons/test_getFaviconURLForPage.js
@@ -1,12 +1,11 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
-const ICON16_URL = "http://places.test/favicon-normal16.png";
const ICON32_URL = "http://places.test/favicon-normal32.png";
add_task(async function test_normal() {
let pageURI = NetUtil.newURI("http://example.com/normal");
await PlacesTestUtils.addVisits(pageURI);
await new Promise(resolve => {
PlacesUtils.favicons.setAndFetchFaviconForPage(
--- a/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js
+++ b/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js
@@ -63,12 +63,8 @@ add_task(async function test_query_resul
// notifications that came from the asynchronous thread, before we can be
// sure that nodeIconChanged was not invoked in the meantime.
await PlacesTestUtils.promiseAsyncUpdates();
result.removeObserver(resultObserver);
// Free the resources immediately.
result.root.containerOpen = false;
});
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/places/tests/favicons/test_replaceFaviconData.js
+++ b/toolkit/components/places/tests/favicons/test_replaceFaviconData.js
@@ -1,17 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* Tests for mozIAsyncFavicons::replaceFaviconData()
*/
var iconsvc = PlacesUtils.favicons;
-var histsvc = PlacesUtils.history;
var originalFavicon = {
file: do_get_file("favicon-normal16.png"),
uri: uri(do_get_file("favicon-normal16.png")),
data: readFileData(do_get_file("favicon-normal16.png")),
mimetype: "image/png"
};
--- a/toolkit/components/places/tests/favicons/test_replaceFaviconDataFromDataURL.js
+++ b/toolkit/components/places/tests/favicons/test_replaceFaviconDataFromDataURL.js
@@ -1,17 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* Tests for mozIAsyncFavicons::replaceFaviconData()
*/
var iconsvc = PlacesUtils.favicons;
-var histsvc = PlacesUtils.history;
var originalFavicon = {
file: do_get_file("favicon-normal16.png"),
uri: uri(do_get_file("favicon-normal16.png")),
data: readFileData(do_get_file("favicon-normal16.png")),
mimetype: "image/png"
};
--- a/toolkit/components/places/tests/history/test_removeVisits.js
+++ b/toolkit/components/places/tests/history/test_removeVisits.js
@@ -1,12 +1,11 @@
const JS_NOW = Date.now();
const DB_NOW = JS_NOW * 1000;
const TEST_URI = uri("http://example.com/");
-const PLACE_URI = uri("place:queryType=0&sort=8&maxResults=10");
async function cleanup() {
await PlacesTestUtils.clearHistory();
await PlacesUtils.bookmarks.eraseEverything();
// This is needed to remove place: entries.
DBConn().executeSimpleSQL("DELETE FROM moz_places");
}
--- a/toolkit/components/places/tests/queries/test_415716.js
+++ b/toolkit/components/places/tests/queries/test_415716.js
@@ -22,20 +22,16 @@ function modHistoryTypes(val) {
case 7:
return TRANSITION_DOWNLOAD;
case 8:
return TRANSITION_FRAMED_LINK;
}
return TRANSITION_TYPED;
}
-function run_test() {
- run_next_test();
-}
-
/**
* Builds a test database by hand using various times, annotations and
* visit numbers for this test
*/
add_task(async function test_buildTestDatabase() {
// This is the set of visits that we will match - our min visit is 2 so that's
// why we add more visits to the same URIs.
let testURI = uri("http://www.foo.com");
--- a/toolkit/components/places/tests/queries/test_abstime-annotation-domain.js
+++ b/toolkit/components/places/tests/queries/test_abstime-annotation-domain.js
@@ -21,21 +21,17 @@ var jan7_800 = (beginTime + DAY_MSEC) *
var jan6_815 = (beginTime + (MIN_MSEC * 15)) * 1000;
var jan11_800 = (beginTime + (DAY_MSEC * 5)) * 1000;
var jan14_2130 = (endTime - DAY_MSEC) * 1000;
var jan15_2045 = (endTime - (MIN_MSEC * 45)) * 1000;
var jan12_1730 = (endTime - (DAY_MSEC * 3) - (HOUR_MSEC * 4)) * 1000;
// Dates outside our query - mult by 1000 to convert to PRTIME
var jan6_700 = (beginTime - HOUR_MSEC) * 1000;
-var jan5_800 = (beginTime - DAY_MSEC) * 1000;
var dec27_800 = (beginTime - (DAY_MSEC * 10)) * 1000;
-var jan15_2145 = (endTime + (MIN_MSEC * 15)) * 1000;
-var jan16_2130 = (endTime + (DAY_MSEC)) * 1000;
-var jan25_2130 = (endTime + (DAY_MSEC * 10)) * 1000;
// So that we can easily use these too, convert them to PRTIME
beginTime *= 1000;
endTime *= 1000;
/**
* Array of objects to build our test database
*/
@@ -115,20 +111,16 @@ var testData = [
/**
* This test will test a Query using several terms and do a bit of negative
* testing for items that should be ignored while querying over history.
* The Query:WHERE absoluteTime(matches) AND searchTerms AND URI
* AND annotationIsNot(match) GROUP BY Domain, Day SORT BY uri,ascending
* excludeITems(should be ignored)
*/
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_abstime_annotation_domain() {
// Initialize database
await task_populateDB(testData);
// Query
var query = PlacesUtils.history.getNewQuery();
query.beginTime = beginTime;
query.endTime = endTime;
--- a/toolkit/components/places/tests/queries/test_abstime-annotation-uri.js
+++ b/toolkit/components/places/tests/queries/test_abstime-annotation-uri.js
@@ -14,28 +14,23 @@ var endTimeDate = new Date(2008, 0, 15,
// These as millisecond values
var beginTime = beginTimeDate.getTime();
var endTime = endTimeDate.getTime();
// Some range dates inside our query - mult by 1000 to convert to PRTIME
var jan7_800 = (beginTime + DAY_MSEC) * 1000;
var jan6_815 = (beginTime + (MIN_MSEC * 15)) * 1000;
-var jan11_800 = (beginTime + (DAY_MSEC * 5)) * 1000;
var jan14_2130 = (endTime - DAY_MSEC) * 1000;
var jan15_2045 = (endTime - (MIN_MSEC * 45)) * 1000;
var jan12_1730 = (endTime - (DAY_MSEC * 3) - (HOUR_MSEC * 4)) * 1000;
// Dates outside our query - mult by 1000 to convert to PRTIME
var jan6_700 = (beginTime - HOUR_MSEC) * 1000;
-var jan5_800 = (beginTime - DAY_MSEC) * 1000;
var dec27_800 = (beginTime - (DAY_MSEC * 10)) * 1000;
-var jan15_2145 = (endTime + (MIN_MSEC * 15)) * 1000;
-var jan16_2130 = (endTime + (DAY_MSEC)) * 1000;
-var jan25_2130 = (endTime + (DAY_MSEC * 10)) * 1000;
// So that we can easily use these too, convert them to PRTIME
beginTime *= 1000;
endTime *= 1000;
/**
* Array of objects to build our test database
*/
@@ -95,20 +90,16 @@ var testData = [
/**
* This test will test a Query using several terms and do a bit of negative
* testing for items that should be ignored while querying over history.
* The Query:WHERE absoluteTime(matches) AND searchTerms AND URI
* AND annotationIsNot(match) GROUP BY Domain, Day SORT BY uri,ascending
* excludeITems(should be ignored)
*/
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_abstime_annotation_uri() {
// Initialize database
await task_populateDB(testData);
// Query
var query = PlacesUtils.history.getNewQuery();
query.beginTime = beginTime;
query.endTime = endTime;
--- a/toolkit/components/places/tests/queries/test_async.js
+++ b/toolkit/components/places/tests/queries/test_async.js
@@ -342,20 +342,16 @@ var DataHelper = {
let dat = {};
for (let [prop, val] of Object.entries(aDefaults)) {
dat[prop] = aData.hasOwnProperty(prop) ? aData[prop] : val;
}
return dat;
}
};
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_async() {
for (let test of tests) {
await PlacesUtils.bookmarks.eraseEverything();
test.__proto__ = new Test();
await test.setup();
print("------ Running test: " + test.desc);
--- a/toolkit/components/places/tests/queries/test_containersQueries_sorting.js
+++ b/toolkit/components/places/tests/queries/test_containersQueries_sorting.js
@@ -9,22 +9,16 @@
* "Want to sort history in container view without sorting the containers"
* and regression bug 488783
* Tags list no longer sorted (alphabetized).
* This test is for global testing sorting containers queries.
*/
// Globals and Constants
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-var bh = hs.QueryInterface(Ci.nsIBrowserHistory);
-var tagging = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
-
var resultTypes = [
{value: Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY, name: "RESULTS_AS_DATE_QUERY"},
{value: Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY, name: "RESULTS_AS_SITE_QUERY"},
{value: Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY, name: "RESULTS_AS_DATE_SITE_QUERY"},
{value: Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY, name: "RESULTS_AS_TAG_QUERY"},
];
var sortingModes = [
@@ -366,20 +360,16 @@ function check_children_sorting(aRootNod
print(i + " index wrong, expected " + sortedResults[i].title +
" found " + results[i].title);
do_check_eq(sortedResults[i].title, results[i].title);
}
}
// Main
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_containersQueries_sorting() {
// Add visits, bookmarks and tags to our database.
var timeInMilliseconds = Date.now();
var visitCount = 0;
var dayOffset = 0;
var visits = [];
pages.forEach(aPageUrl => visits.push(
{ isVisit: true,
--- a/toolkit/components/places/tests/queries/test_history_queries_tags_liveUpdate.js
+++ b/toolkit/components/places/tests/queries/test_history_queries_tags_liveUpdate.js
@@ -51,20 +51,16 @@ function newQueryWithOptions() {
function testQueryContents(aQuery, aOptions, aCallback) {
let root = PlacesUtils.history.executeQuery(aQuery, aOptions).root;
root.containerOpen = true;
aCallback(root);
root.containerOpen = false;
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_initialize() {
await task_populateDB(gTestData);
});
add_task(function pages_query() {
let [query, options] = newQueryWithOptions();
testQueryContents(query, options, function(root) {
compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
--- a/toolkit/components/places/tests/queries/test_history_queries_titles_liveUpdate.js
+++ b/toolkit/components/places/tests/queries/test_history_queries_titles_liveUpdate.js
@@ -44,20 +44,16 @@ function searchNodeHavingUrl(aRoot, aUrl
return undefined;
}
function newQueryWithOptions() {
return [ PlacesUtils.history.getNewQuery(),
PlacesUtils.history.getNewQueryOptions() ];
}
-function run_test() {
- run_next_test();
-}
-
add_task(async function pages_query() {
await task_populateDB(gTestData);
let [query, options] = newQueryWithOptions();
let root = PlacesUtils.history.executeQuery(query, options).root;
root.containerOpen = true;
compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
--- a/toolkit/components/places/tests/queries/test_onlyBookmarked.js
+++ b/toolkit/components/places/tests/queries/test_onlyBookmarked.js
@@ -33,25 +33,16 @@ var testData = [
// Add an un-bookmarked visit
{ isVisit: true,
uri: "http://notbookmarked.com/",
isInQuery: false }
];
-/**
- * run_test is where the magic happens. This is automatically run by the test
- * harness. It is where you do the work of creating the query, running it, and
- * playing with the result set.
- */
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_onlyBookmarked() {
// This function in head_queries.js creates our database with the above data
await task_populateDB(testData);
// Query
var query = PlacesUtils.history.getNewQuery();
query.setFolders([PlacesUtils.toolbarFolderId], 1);
query.onlyBookmarked = true;
--- a/toolkit/components/places/tests/queries/test_queryMultipleFolder.js
+++ b/toolkit/components/places/tests/queries/test_queryMultipleFolder.js
@@ -1,17 +1,13 @@
/* 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(async function test_queryMultipleFolders() {
// adding bookmarks in the folders
let folderIds = [];
let bookmarkIds = [];
for (let i = 0; i < 3; ++i) {
let folder = await PlacesUtils.bookmarks.insert({
parentGuid: PlacesUtils.bookmarks.menuGuid,
type: PlacesUtils.bookmarks.TYPE_FOLDER,
--- a/toolkit/components/places/tests/queries/test_redirects.js
+++ b/toolkit/components/places/tests/queries/test_redirects.js
@@ -170,20 +170,16 @@ function cartProd(aSequences, aCallback)
if (seqPtr < 0)
done = true;
} else break;
}
}
return numProds;
}
-function run_test() {
- run_next_test();
-}
-
/**
* Populate the visits array and add visits to the database.
* We will generate visit-chains like:
* visit -> redirect_temp -> redirect_perm
*/
add_task(async function test_add_visits_to_database() {
await PlacesUtils.bookmarks.eraseEverything();
--- a/toolkit/components/places/tests/queries/test_results-as-tag-contents-query.js
+++ b/toolkit/components/places/tests/queries/test_results-as-tag-contents-query.js
@@ -54,20 +54,16 @@ function getIdForTag(aTagName) {
}
root.containerOpen = false;
return id;
}
/**
* This test will test Queries that use relative search terms and URI options
*/
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_results_as_tag_contents_query() {
await task_populateDB(testData);
// Get tag id.
let tagId = getIdForTag("bugzilla");
do_check_true(tagId > 0);
var options = PlacesUtils.history.getNewQueryOptions();
--- a/toolkit/components/places/tests/queries/test_results-as-visit.js
+++ b/toolkit/components/places/tests/queries/test_results-as-visit.js
@@ -32,20 +32,16 @@ function createTestData() {
{ uri: "http://foo.mail.com/changeme3.html", title: "zydeco", visitCount: 5, inQuery: false },
];
pages.forEach(generateVisits);
}
/**
* This test will test Queries that use relative search terms and URI options
*/
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_results_as_visit() {
createTestData();
await task_populateDB(testData);
var query = PlacesUtils.history.getNewQuery();
query.searchTerms = "moz";
query.minVisits = 2;
// Options
--- a/toolkit/components/places/tests/queries/test_searchTerms_includeHidden.js
+++ b/toolkit/components/places/tests/queries/test_searchTerms_includeHidden.js
@@ -43,20 +43,16 @@ const TEST_DATA = [
expectedResults: 1
},
{ searchTerms: "red",
includeHidden: true,
expectedResults: 1
}
];
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_initalize() {
await task_populateDB(VISITS);
});
add_task(async function test_searchTerms_includeHidden() {
for (let data of TEST_DATA) {
let query = PlacesUtils.history.getNewQuery();
query.searchTerms = data.searchTerms;
--- a/toolkit/components/places/tests/queries/test_searchterms-bookmarklets.js
+++ b/toolkit/components/places/tests/queries/test_searchterms-bookmarklets.js
@@ -12,20 +12,16 @@ var testData = [
{ isInQuery: true,
isBookmark: true,
title: "bookmark 2",
uri: "javascript:alert('moz');"
}
];
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_initalize() {
await task_populateDB(testData);
});
add_test(function test_search_by_title() {
let query = PlacesUtils.history.getNewQuery();
query.searchTerms = "bookmark";
let options = PlacesUtils.history.getNewQueryOptions();
--- a/toolkit/components/places/tests/queries/test_searchterms-domain.js
+++ b/toolkit/components/places/tests/queries/test_searchterms-domain.js
@@ -50,20 +50,16 @@
// Test another invalid title - for updating later
{isInQuery: false, isVisit: true, isDetails: true, title: "m,oz",
uri: "http://foo.com/changeme2.htm", lastVisit: yesterday}];
/**
* This test will test Queries that use relative search terms and domain options
*/
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_searchterms_domain() {
await task_populateDB(testData);
var query = PlacesUtils.history.getNewQuery();
query.searchTerms = "moz";
query.domain = "foo.com";
query.domainIsHost = false;
// Options
--- a/toolkit/components/places/tests/queries/test_searchterms-uri.js
+++ b/toolkit/components/places/tests/queries/test_searchterms-uri.js
@@ -36,20 +36,16 @@
// Test another invalid title - for updating later
{isInQuery: false, isVisit: true, isDetails: true, title: "m,oz",
uri: "http://foo.com/changeme2.htm", lastVisit: yesterday}];
/**
* This test will test Queries that use relative search terms and URI options
*/
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_searchterms_uri() {
await task_populateDB(testData);
var query = PlacesUtils.history.getNewQuery();
query.searchTerms = "moz";
query.uri = uri("http://foo.com");
// Options
var options = PlacesUtils.history.getNewQueryOptions();
--- a/toolkit/components/places/tests/queries/test_sort-date-site-grouping.js
+++ b/toolkit/components/places/tests/queries/test_sort-date-site-grouping.js
@@ -60,17 +60,16 @@ var testData = [
{
isVisit: true,
uri: "http://example.net/1",
lastVisit: olderthansixmonths + 1000,
title: "test visit",
isInQuery: true
}
];
-var domainsInRange = [2, 3];
var leveledTestData = [// Today
[[0], // Today, local files
[1, 2]], // Today, example.com
// Older than six months
[[3], // Older than six months, local files
[4, 5], // Older than six months, example.com
[6] // Older than six months, example.net
]];
@@ -107,20 +106,16 @@ var testDataAddedLater = [
uri: "file:///directory/3",
lastVisit: today,
title: "test visit",
isInQuery: true,
levels: [0, 0]
}
];
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_sort_date_site_grouping() {
await task_populateDB(testData);
// On Linux, the (local files) folder is shown after sites unlike Mac/Windows.
// Thus, we avoid running this test on Linux but this should be re-enabled
// after bug 624024 is resolved.
let isLinux = ("@mozilla.org/gnome-gconf-service;1" in Components.classes);
if (isLinux)
--- a/toolkit/components/places/tests/queries/test_sorting.js
+++ b/toolkit/components/places/tests/queries/test_sorting.js
@@ -1240,20 +1240,16 @@ tests.push({
check_reverse() {
this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_FRECENCY_DESCENDING;
this._sortedData.reverse();
this.check();
}
});
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_sorting() {
for (let test of tests) {
await test.setup();
await PlacesTestUtils.promiseAsyncUpdates();
test.check();
// sorting reversed, usually SORT_BY have ASC and DESC
test.check_reverse();
// Execute cleanup tasks
--- a/toolkit/components/places/tests/queries/test_tags.js
+++ b/toolkit/components/places/tests/queries/test_tags.js
@@ -721,12 +721,8 @@ function setsAreEqual(aArr1, aArr2, aIsO
for (let i = 0; i < aArr1.length; i++) {
do_check_eq(aArr1[i], aArr2[i]);
}
} else {
aArr1.forEach(u => do_check_true(aArr2.indexOf(u) >= 0));
aArr2.forEach(u => do_check_true(aArr1.indexOf(u) >= 0));
}
}
-
-function run_test() {
- run_next_test();
-}
--- a/toolkit/components/places/tests/queries/test_transitions.js
+++ b/toolkit/components/places/tests/queries/test_transitions.js
@@ -1,15 +1,14 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et: */
/* ***** BEGIN LICENSE BLOCK *****
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
* ***** END LICENSE BLOCK ***** */
-var beginTime = Date.now();
var testData = [
{
isVisit: true,
title: "page 0",
uri: "http://mozilla.com/",
transType: Ci.nsINavHistoryService.TRANSITION_TYPED
},
{
@@ -78,25 +77,16 @@ var testData = [
uri: "http://arewefastyet.com/",
transType: Ci.nsINavHistoryService.TRANSITION_BOOKMARK
}];
// sets of indices of testData array by transition type
var testDataTyped = [0, 5, 7, 9];
var testDataDownload = [1, 2, 4, 6, 10];
var testDataBookmark = [3, 8, 11];
-/**
- * run_test is where the magic happens. This is automatically run by the test
- * harness. It is where you do the work of creating the query, running it, and
- * playing with the result set.
- */
-function run_test() {
- run_next_test();
-}
-
add_task(async function test_transitions() {
let timeNow = Date.now();
for (let item of testData) {
await PlacesTestUtils.addVisits({
uri: uri(item.uri),
transition: item.transType,
visitDate: timeNow++ * 1000,
title: item.title
--- a/toolkit/components/places/tests/unit/test_000_frecency.js
+++ b/toolkit/components/places/tests/unit/test_000_frecency.js
@@ -44,17 +44,16 @@ var bonusPrefs = {
permRedirectVisitBonus: Ci.nsINavHistoryService.TRANSITION_REDIRECT_PERMANENT,
tempRedirectVisitBonus: Ci.nsINavHistoryService.TRANSITION_REDIRECT_TEMPORARY,
reloadVisitBonus: Ci.nsINavHistoryService.TRANSITION_RELOAD,
};
// create test data
var searchTerm = "frecency";
var results = [];
-var matchCount = 0;
var now = Date.now();
var prefPrefix = "places.frecency.";
async function task_initializeBucket(bucket) {
let [cutoffName, weightName] = bucket;
// get pref values
var weight = prefs.getIntPref(prefPrefix + weightName, 0);
var cutoff = prefs.getIntPref(prefPrefix + cutoffName, 0);
--- a/toolkit/components/places/tests/unit/test_402799.js
+++ b/toolkit/components/places/tests/unit/test_402799.js
@@ -3,17 +3,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Get history services
try {
var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
- var bhist = histsvc.QueryInterface(Ci.nsIBrowserHistory);
} catch (ex) {
do_throw("Could not get history services\n");
}
// Get bookmark service
try {
var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
--- a/toolkit/components/places/tests/unit/test_413784.js
+++ b/toolkit/components/places/tests/unit/test_413784.js
@@ -9,21 +9,16 @@
Test autocomplete for non-English URLs
- add a visit for a page with a non-English URL
- search
- test number of matches (should be exactly one)
*/
-var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
// create test data
var searchTerm = "ユニコード";
var decoded = "http://www.foobar.com/" + searchTerm + "/";
var url = uri(decoded);
function AutoCompleteInput(aSearches) {
this.searches = aSearches;
}
--- a/toolkit/components/places/tests/unit/test_adaptive_bug527311.js
+++ b/toolkit/components/places/tests/unit/test_adaptive_bug527311.js
@@ -5,18 +5,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const TEST_URL = "http://adapt.mozilla.org/";
const SEARCH_STRING = "adapt";
const SUGGEST_TYPES = ["history", "bookmark", "openpage"];
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
var os = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
var ps = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
const PLACES_AUTOCOMPLETE_FEEDBACK_UPDATED_TOPIC =
--- a/toolkit/components/places/tests/unit/test_async_transactions.js
+++ b/toolkit/components/places/tests/unit/test_async_transactions.js
@@ -241,17 +241,17 @@ function ensureTimestampsUpdated(aGuid,
function ensureTagsForURI(aURI, aTags) {
let tagsSet = tagssvc.getTagsForURI(aURI);
do_check_eq(tagsSet.length, aTags.length);
do_check_true(aTags.every( t => tagsSet.includes(t)));
}
function createTestFolderInfo(aTitle = "Test Folder") {
- return { parentGuid: rootGuid, title: "Test Folder" };
+ return { parentGuid: rootGuid, title: aTitle };
}
function isLivemarkTree(aTree) {
return !!aTree.annos &&
aTree.annos.some( a => a.name == PlacesUtils.LMANNO_FEEDURI );
}
async function ensureLivemarkCreatedByAddLivemark(aLivemarkGuid) {
--- a/toolkit/components/places/tests/unit/test_autocomplete_stopSearch_no_throw.js
+++ b/toolkit/components/places/tests/unit/test_autocomplete_stopSearch_no_throw.js
@@ -6,18 +6,16 @@
/**
* Added with bug 508102 to make sure that calling stopSearch on our
* AutoComplete implementation does not throw.
*/
// Globals and Constants
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
var ac = Cc["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"].
getService(Ci.nsIAutoCompleteSearch);
// Test Functions
function test_stopSearch() {
try {
ac.stopSearch();
--- a/toolkit/components/places/tests/unit/test_frecency.js
+++ b/toolkit/components/places/tests/unit/test_frecency.js
@@ -104,19 +104,16 @@ function ensure_results_internal(uris, s
deferEnsureResults.resolve();
};
controller.startSearch(searchTerm);
}
// Get history service
try {
- var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
- var bhist = histsvc.QueryInterface(Ci.nsIBrowserHistory);
var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
getService(Ci.nsITaggingService);
var bmksvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
} catch (ex) {
do_throw("Could not get history service\n");
}
--- a/toolkit/components/places/tests/unit/test_history_sidebar.js
+++ b/toolkit/components/places/tests/unit/test_history_sidebar.js
@@ -2,21 +2,18 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Get history service
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
-var bh = hs.QueryInterface(Ci.nsIBrowserHistory);
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
-var ps = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
/**
* Adds a test URI visit to the database.
*
* @param aURI
* The URI to add a visit for.
* @param aTime
* Reference "now" time.
--- a/toolkit/components/places/tests/unit/test_preventive_maintenance.js
+++ b/toolkit/components/places/tests/unit/test_preventive_maintenance.js
@@ -8,18 +8,16 @@
* Test preventive maintenance
* For every maintenance query create an uncoherent db and check that we take
* correct fix steps, without polluting valid data.
*/
// Include PlacesDBUtils module
Components.utils.import("resource://gre/modules/PlacesDBUtils.jsm");
-const FINISHED_MAINTENANCE_NOTIFICATION_TOPIC = "places-maintenance-finished";
-
// Get services and database connection
var hs = PlacesUtils.history;
var bs = PlacesUtils.bookmarks;
var ts = PlacesUtils.tagging;
var as = PlacesUtils.annotations;
var fs = PlacesUtils.favicons;
var mDBConn = hs.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection;
--- a/toolkit/components/places/tests/unit/test_utils_setAnnotationsFor.js
+++ b/toolkit/components/places/tests/unit/test_utils_setAnnotationsFor.js
@@ -3,17 +3,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Check for correct functionality of PlacesUtils.setAnnotationsForItem/URI
*/
-var hs = PlacesUtils.history;
var bs = PlacesUtils.bookmarks;
var as = PlacesUtils.annotations;
const TEST_URL = "http://test.mozilla.org/";
function run_test() {
var testURI = uri(TEST_URL);
// add a bookmark