diff --git a/browser/base/content/test/general/browser_bug581253.js b/browser/base/content/test/general/browser_bug581253.js index 8cfbcf7c990b..7da6d613fb7d 100644 --- a/browser/base/content/test/general/browser_bug581253.js +++ b/browser/base/content/test/general/browser_bug581253.js @@ -13,7 +13,7 @@ add_task(async function test_remove_bookmark_with_tag_via_edit_bookmark() { registerCleanupFunction(async function() { await PlacesUtils.bookmarks.eraseEverything(); await BrowserTestUtils.removeTab(tab); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); await PlacesUtils.bookmarks.insert({ diff --git a/browser/base/content/test/general/browser_contentAltClick.js b/browser/base/content/test/general/browser_contentAltClick.js index e64626190950..58dc12c9d8c4 100644 --- a/browser/base/content/test/general/browser_contentAltClick.js +++ b/browser/base/content/test/general/browser_contentAltClick.js @@ -14,8 +14,6 @@ ChromeUtils.defineModuleGetter(this, "Downloads", "resource://gre/modules/Downloads.jsm"); -ChromeUtils.defineModuleGetter(this, "PlacesTestUtils", - "resource://testing-common/PlacesTestUtils.jsm"); function setup() { Services.prefs.setBoolPref("browser.altClickSave", true); @@ -38,7 +36,7 @@ async function clean_up() { await download.finalize(true); } // Remove download history. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); Services.prefs.clearUserPref("browser.altClickSave"); await BrowserTestUtils.removeTab(gBrowser.selectedTab); diff --git a/browser/base/content/test/metaTags/browser_bad_meta_tags.js b/browser/base/content/test/metaTags/browser_bad_meta_tags.js index 9a4e2aa9eb0b..f58857f260b4 100644 --- a/browser/base/content/test/metaTags/browser_bad_meta_tags.js +++ b/browser/base/content/test/metaTags/browser_bad_meta_tags.js @@ -20,6 +20,6 @@ add_task(async function test_bad_meta_tags() { is(pageInfo.previewImageURL.href, "http://test.com/twitter-image.jpg", "did not collect og:image because of invalid loading principal"); await BrowserTestUtils.removeTab(tab); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/browser/base/content/test/metaTags/browser_meta_tags.js b/browser/base/content/test/metaTags/browser_meta_tags.js index a8d57c2ac057..ac1068008307 100644 --- a/browser/base/content/test/metaTags/browser_meta_tags.js +++ b/browser/base/content/test/metaTags/browser_meta_tags.js @@ -19,7 +19,7 @@ add_task(async function test_metadata() { is(pageInfo.previewImageURL.href, "https://test.com/og-image-secure-url.jpg", "got the correct preview image"); await BrowserTestUtils.removeTab(tab); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); /** @@ -41,5 +41,5 @@ add_task(async function multiple_tabs() { await BrowserTestUtils.removeTab(tab); await BrowserTestUtils.removeTab(gBrowser.selectedTab); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/browser/base/content/test/newtab/head.js b/browser/base/content/test/newtab/head.js index d94949d8ce4c..a22a84eb89a7 100644 --- a/browser/base/content/test/newtab/head.js +++ b/browser/base/content/test/newtab/head.js @@ -126,7 +126,7 @@ add_task(async function setup() { registerCleanupFunction(function() { return new Promise(resolve => { function cleanupAndFinish() { - PlacesTestUtils.clearHistory().then(() => { + PlacesUtils.history.clear().then(() => { whenPagesUpdated().then(resolve); NewTabUtils.restore(); }); @@ -194,7 +194,7 @@ function setLinks(aLinks) { // given entries and call populateCache() now again to make sure the cache // has the desired contents. NewTabUtils.links.populateCache(function() { - PlacesTestUtils.clearHistory().then(() => { + PlacesUtils.history.clear().then(() => { fillHistory(links).then(() => { NewTabUtils.links.populateCache(function() { NewTabUtils.allPages.update(); diff --git a/browser/base/content/test/sanitize/browser_sanitizeDialog.js b/browser/base/content/test/sanitize/browser_sanitizeDialog.js index 45a0be32cf8f..bf22c8df0033 100644 --- a/browser/base/content/test/sanitize/browser_sanitizeDialog.js +++ b/browser/base/content/test/sanitize/browser_sanitizeDialog.js @@ -966,7 +966,7 @@ async function blankSlate() { }); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } /** diff --git a/browser/base/content/test/urlbar/browser_autocomplete_autoselect.js b/browser/base/content/test/urlbar/browser_autocomplete_autoselect.js index edc8f371d6b6..c1ce6fdae63c 100644 --- a/browser/base/content/test/urlbar/browser_autocomplete_autoselect.js +++ b/browser/base/content/test/urlbar/browser_autocomplete_autoselect.js @@ -33,7 +33,7 @@ add_task(async function() { Services.prefs.setBoolPref(ONEOFF_URLBAR_PREF, true); let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:mozilla"); registerCleanupFunction(async function() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); Services.prefs.clearUserPref(ONEOFF_URLBAR_PREF); await BrowserTestUtils.removeTab(tab); }); diff --git a/browser/base/content/test/urlbar/browser_bug1003461-switchtab-override.js b/browser/base/content/test/urlbar/browser_bug1003461-switchtab-override.js index 878e84ed3f2f..4bf4e9501b3b 100644 --- a/browser/base/content/test/urlbar/browser_bug1003461-switchtab-override.js +++ b/browser/base/content/test/urlbar/browser_bug1003461-switchtab-override.js @@ -57,5 +57,5 @@ add_task(async function test_switchtab_override() { EventUtils.synthesizeKey("VK_SHIFT", { type: "keyup" }); await deferred.promise; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/browser/base/content/test/urlbar/browser_bug1024133-switchtab-override-keynav.js b/browser/base/content/test/urlbar/browser_bug1024133-switchtab-override-keynav.js index a63b8088085f..f2127906b9c0 100644 --- a/browser/base/content/test/urlbar/browser_bug1024133-switchtab-override-keynav.js +++ b/browser/base/content/test/urlbar/browser_bug1024133-switchtab-override-keynav.js @@ -15,7 +15,7 @@ add_task(async function test_switchtab_override_keynav() { gBrowser.removeTab(tab); gBrowser.removeTab(secondTab); } catch (ex) { /* tabs may have already been closed in case of failure */ } - return PlacesTestUtils.clearHistory(); + return PlacesUtils.history.clear(); }); gURLBar.focus(); diff --git a/browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js b/browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js index 2d40e48cfc5f..8920abf10305 100644 --- a/browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js +++ b/browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js @@ -24,5 +24,5 @@ add_task(async function test_switchtab_decodeuri() { }); gBrowser.removeCurrentTab(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/browser/base/content/test/urlbar/browser_search_favicon.js b/browser/base/content/test/urlbar/browser_search_favicon.js index 5d4f9976fb43..f6e9061119dc 100644 --- a/browser/base/content/test/urlbar/browser_search_favicon.js +++ b/browser/base/content/test/urlbar/browser_search_favicon.js @@ -6,7 +6,7 @@ registerCleanupFunction(() => { Services.prefs.clearUserPref(gRestyleSearchesPref); Services.search.currentEngine = gOriginalEngine; Services.search.removeEngine(gEngine); - return PlacesTestUtils.clearHistory(); + return PlacesUtils.history.clear(); }); add_task(async function() { diff --git a/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js b/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js index 22f45ba9812f..1200899c1713 100644 --- a/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js +++ b/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js @@ -113,7 +113,7 @@ add_task(async function step_7() { add_task(async function cleanup() { info("Cleaning up"); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); function loadTab(tab, url) { diff --git a/browser/base/content/test/urlbar/browser_urlbarAutoFillTrimURLs.js b/browser/base/content/test/urlbar/browser_urlbarAutoFillTrimURLs.js index d7305b792e04..62ddc3462a08 100644 --- a/browser/base/content/test/urlbar/browser_urlbarAutoFillTrimURLs.js +++ b/browser/base/content/test/urlbar/browser_urlbarAutoFillTrimURLs.js @@ -8,7 +8,7 @@ add_task(async function setup() { registerCleanupFunction(async function() { Services.prefs.clearUserPref(PREF_TRIMURL); Services.prefs.clearUserPref(PREF_AUTOFILL); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); gURLBar.handleRevert(); }); Services.prefs.setBoolPref(PREF_TRIMURL, true); diff --git a/browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js b/browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js index 7ef7f8a0d9ca..d324f562c586 100644 --- a/browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js +++ b/browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js @@ -19,10 +19,10 @@ let gMaxResults; add_task(async function() { registerCleanupFunction(async function() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); gMaxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults"); diff --git a/browser/base/content/test/urlbar/browser_urlbarOneOffs.js b/browser/base/content/test/urlbar/browser_urlbarOneOffs.js index f897d24a0bd9..ce8d39d4fb6d 100644 --- a/browser/base/content/test/urlbar/browser_urlbarOneOffs.js +++ b/browser/base/content/test/urlbar/browser_urlbarOneOffs.js @@ -13,10 +13,10 @@ add_task(async function init() { registerCleanupFunction(async function() { await hidePopup(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let visits = []; for (let i = 0; i < gMaxResults; i++) { diff --git a/browser/base/content/test/urlbar/browser_urlbarOneOffs_searchSuggestions.js b/browser/base/content/test/urlbar/browser_urlbarOneOffs_searchSuggestions.js index 8e5b06cdbdc9..c426278df1ad 100644 --- a/browser/base/content/test/urlbar/browser_urlbarOneOffs_searchSuggestions.js +++ b/browser/base/content/test/urlbar/browser_urlbarOneOffs_searchSuggestions.js @@ -1,7 +1,7 @@ const TEST_ENGINE_BASENAME = "searchSuggestionEngine.xml"; add_task(async function init() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.oneOffSearches", true], ["browser.urlbar.suggest.searches", true]], @@ -13,7 +13,7 @@ add_task(async function init() { registerCleanupFunction(async function() { Services.search.currentEngine = oldCurrentEngine; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); // Make sure the popup is closed for the next test. gURLBar.blur(); Assert.ok(!gURLBar.popup.popupOpen, "popup should be closed"); @@ -48,7 +48,7 @@ add_task(async function oneOffReturnAfterSuggestion() { EventUtils.synthesizeKey("VK_RETURN", {}); await resultsPromise; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await BrowserTestUtils.removeTab(tab); }); @@ -76,7 +76,7 @@ add_task(async function oneOffClickAfterSuggestion() { EventUtils.synthesizeMouseAtCenter(oneOffs[0], {}); await resultsPromise; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await BrowserTestUtils.removeTab(tab); }); diff --git a/browser/base/content/test/urlbar/browser_urlbarSearchSuggestions.js b/browser/base/content/test/urlbar/browser_urlbarSearchSuggestions.js index 7bbc0ca356ac..ac86779ef4ea 100644 --- a/browser/base/content/test/urlbar/browser_urlbarSearchSuggestions.js +++ b/browser/base/content/test/urlbar/browser_urlbarSearchSuggestions.js @@ -14,7 +14,7 @@ add_task(async function prepare() { // Clicking suggestions causes visits to search results pages, so clear that // history now. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); // Make sure the popup is closed for the next test. gURLBar.blur(); diff --git a/browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js b/browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js index 68031f847721..8968ee2150cf 100644 --- a/browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js +++ b/browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js @@ -19,7 +19,7 @@ add_task(async function prepare() { // Clicking urlbar results causes visits to their associated pages, so clear // that history now. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); // Make sure the popup is closed for the next test. gURLBar.blur(); diff --git a/browser/base/content/test/urlbar/browser_urlbar_autoFill_backspaced.js b/browser/base/content/test/urlbar/browser_urlbar_autoFill_backspaced.js index 72b04c6fa49b..4f462427ef56 100644 --- a/browser/base/content/test/urlbar/browser_urlbar_autoFill_backspaced.js +++ b/browser/base/content/test/urlbar/browser_urlbar_autoFill_backspaced.js @@ -32,7 +32,7 @@ add_task(async function() { registerCleanupFunction(async function() { Services.prefs.clearUserPref("browser.urlbar.autoFill"); gURLBar.handleRevert(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); Services.prefs.setBoolPref("browser.urlbar.autoFill", true); @@ -142,5 +142,5 @@ add_task(async function() { } }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/browser/base/content/test/urlbar/browser_urlbar_canonize_on_autofill.js b/browser/base/content/test/urlbar/browser_urlbar_canonize_on_autofill.js index fd55b07a0190..54fa1490b8d2 100644 --- a/browser/base/content/test/urlbar/browser_urlbar_canonize_on_autofill.js +++ b/browser/base/content/test/urlbar/browser_urlbar_canonize_on_autofill.js @@ -26,7 +26,7 @@ add_task(async function() { registerCleanupFunction(async function() { Services.prefs.clearUserPref("browser.urlbar.autoFill"); gURLBar.handleRevert(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); Services.prefs.setBoolPref("browser.urlbar.autoFill", true); diff --git a/browser/components/extensions/test/browser/browser_ext_webNavigation_urlbar_transitions.js b/browser/components/extensions/test/browser/browser_ext_webNavigation_urlbar_transitions.js index f31d89165e25..8c66f0b8fb0e 100644 --- a/browser/components/extensions/test/browser/browser_ext_webNavigation_urlbar_transitions.js +++ b/browser/components/extensions/test/browser/browser_ext_webNavigation_urlbar_transitions.js @@ -77,7 +77,7 @@ async function prepareSearchEngine() { // Clicking suggestions causes visits to search results pages, so clear that // history now. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); } diff --git a/browser/components/extensions/test/xpcshell/test_ext_history.js b/browser/components/extensions/test/xpcshell/test_ext_history.js index 7490cb4ca0f5..989f643d4948 100644 --- a/browser/components/extensions/test/xpcshell/test_ext_history.js +++ b/browser/components/extensions/test/xpcshell/test_ext_history.js @@ -61,7 +61,7 @@ add_task(async function test_delete() { await extension.startup(); await extension.awaitMessage("ready"); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let historyClearedCount; let visits = []; @@ -227,7 +227,7 @@ add_task(async function test_search() { await extension.startup(); await extension.awaitMessage("ready"); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.history.insertMany(PAGE_INFOS); @@ -254,7 +254,7 @@ add_task(async function test_search() { await extension.awaitFinish("search"); await extension.unload(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_add_url() { @@ -321,7 +321,7 @@ add_task(async function test_add_url() { background: `(${background})()`, }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await extension.startup(); await extension.awaitMessage("ready"); @@ -397,7 +397,7 @@ add_task(async function test_get_visits() { background: `(${background})()`, }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await extension.startup(); await extension.awaitFinish("get-visits"); @@ -460,7 +460,7 @@ add_task(async function test_transition_types() { background, }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await extension.startup(); await extension.awaitMessage("ready"); @@ -540,7 +540,7 @@ add_task(async function test_on_visited() { background: `(${background})()`, }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await extension.startup(); await extension.awaitMessage("ready"); diff --git a/browser/components/migration/tests/unit/test_automigration.js b/browser/components/migration/tests/unit/test_automigration.js index d9186c877b01..650b886b67dd 100644 --- a/browser/components/migration/tests/unit/test_automigration.js +++ b/browser/components/migration/tests/unit/test_automigration.js @@ -542,7 +542,7 @@ add_task(async function checkUndoVisitsState() { last: new Date("2016-04-03").getTime() * 1000, }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function checkUndoVisitsState() { @@ -675,7 +675,7 @@ add_task(async function checkUndoVisitsState() { "2 example.org visits should have persisted (out of 4)."); Assert.equal(await visitsForURL("http://www.unrelated.org/"), 1, "1 unrelated.org visits should have persisted as it's not involved in the import."); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function checkHistoryRemovalCompletion() { diff --git a/browser/components/places/tests/browser/browser_bookmarkProperties_cancel.js b/browser/components/places/tests/browser/browser_bookmarkProperties_cancel.js index 82378f6776cd..bbceefe9c17f 100644 --- a/browser/components/places/tests/browser/browser_bookmarkProperties_cancel.js +++ b/browser/components/places/tests/browser/browser_bookmarkProperties_cancel.js @@ -9,7 +9,7 @@ registerCleanupFunction(async function() { sandbox.restore(); delete window.sinon; await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); let bookmarks; // Bookmarks added via insertTree. diff --git a/browser/components/places/tests/browser/browser_bookmarksProperties.js b/browser/components/places/tests/browser/browser_bookmarksProperties.js index 1161d4a3231f..9dc7205fe5b9 100644 --- a/browser/components/places/tests/browser/browser_bookmarksProperties.js +++ b/browser/components/places/tests/browser/browser_bookmarksProperties.js @@ -336,7 +336,7 @@ gTests.push({ delete this._removeObserver; await PlacesTestUtils.promiseAsyncUpdates(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } }); diff --git a/browser/components/places/tests/browser/browser_controller_onDrop.js b/browser/components/places/tests/browser/browser_controller_onDrop.js index 7da6a87396a9..82e6103ab50b 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop.js @@ -17,7 +17,7 @@ add_task(async function setup() { sandbox.restore(); delete window.sinon; await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); sandbox.stub(PlacesUIUtils, "getTransactionForData"); diff --git a/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js b/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js index 7f4d0ec13a95..cabdc983cd19 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js @@ -18,7 +18,7 @@ add_task(async function setup() { sandbox.restore(); delete window.sinon; await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); sandbox.stub(PlacesTransactions, "batch"); diff --git a/browser/components/places/tests/browser/browser_forgetthissite_single.js b/browser/components/places/tests/browser/browser_forgetthissite_single.js index 3c9d65648ab6..a6119ec330b2 100644 --- a/browser/components/places/tests/browser/browser_forgetthissite_single.js +++ b/browser/components/places/tests/browser/browser_forgetthissite_single.js @@ -24,7 +24,7 @@ add_task(async function() { await testForgetThisSiteVisibility(2); // Cleanup. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); var testForgetThisSiteVisibility = async function(selectionCount) { diff --git a/browser/components/places/tests/browser/browser_history_sidebar_search.js b/browser/components/places/tests/browser/browser_history_sidebar_search.js index e37bf430d6ad..c89163f54a36 100644 --- a/browser/components/places/tests/browser/browser_history_sidebar_search.js +++ b/browser/components/places/tests/browser/browser_history_sidebar_search.js @@ -12,7 +12,7 @@ add_task(async function test() { // Number of pages that will be filtered out by the search. const FILTERED_COUNT = 1; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); // Add some visited page. let time = Date.now(); @@ -43,7 +43,7 @@ add_task(async function test() { check_tree_order(tree, pages); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); function check_tree_order(tree, pages, aNumberOfRowsDelta = 0) { diff --git a/browser/components/places/tests/browser/browser_library_commands.js b/browser/components/places/tests/browser/browser_library_commands.js index e460acef2d95..1734af3b6b92 100644 --- a/browser/components/places/tests/browser/browser_library_commands.js +++ b/browser/components/places/tests/browser/browser_library_commands.js @@ -12,7 +12,7 @@ const TEST_URI = NetUtil.newURI("http://www.mozilla.org/"); registerCleanupFunction(async function() { await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_date_container() { diff --git a/browser/components/places/tests/browser/browser_library_delete_bookmarks_in_tags.js b/browser/components/places/tests/browser/browser_library_delete_bookmarks_in_tags.js index 9032eb207bde..7fbc031031ba 100644 --- a/browser/components/places/tests/browser/browser_library_delete_bookmarks_in_tags.js +++ b/browser/components/places/tests/browser/browser_library_delete_bookmarks_in_tags.js @@ -10,7 +10,7 @@ registerCleanupFunction(async function() { await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_tags() { diff --git a/browser/components/places/tests/browser/browser_library_delete_tags.js b/browser/components/places/tests/browser/browser_library_delete_tags.js index 59239f1f274a..c123cbf1706f 100644 --- a/browser/components/places/tests/browser/browser_library_delete_tags.js +++ b/browser/components/places/tests/browser/browser_library_delete_tags.js @@ -10,7 +10,7 @@ registerCleanupFunction(async function() { await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_tags() { diff --git a/browser/components/places/tests/browser/browser_library_downloads.js b/browser/components/places/tests/browser/browser_library_downloads.js index 4cc0dea7b906..55bbbecf5994 100644 --- a/browser/components/places/tests/browser/browser_library_downloads.js +++ b/browser/components/places/tests/browser/browser_library_downloads.js @@ -51,7 +51,7 @@ function test() { } win.close(); - PlacesTestUtils.clearHistory().then(finish); + PlacesUtils.history.clear().then(finish); } }); }; diff --git a/browser/components/places/tests/browser/browser_library_infoBox.js b/browser/components/places/tests/browser/browser_library_infoBox.js index 65e16f3c7abe..4a4b9ae97163 100644 --- a/browser/components/places/tests/browser/browser_library_infoBox.js +++ b/browser/components/places/tests/browser/browser_library_infoBox.js @@ -13,7 +13,7 @@ add_task(async function() { gLibrary = await promiseLibrary(); registerCleanupFunction(async () => { gLibrary.close(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); gLibrary.PlacesOrganizer._places.focus(); diff --git a/browser/components/places/tests/browser/browser_paste_into_tags.js b/browser/components/places/tests/browser/browser_paste_into_tags.js index e3fc0ad874bc..577faccfc1a5 100644 --- a/browser/components/places/tests/browser/browser_paste_into_tags.js +++ b/browser/components/places/tests/browser/browser_paste_into_tags.js @@ -83,7 +83,7 @@ add_task(async function() { is(tags.length, 0, "tags are gone"); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); function focusTag(PlacesOrganizer) { diff --git a/browser/components/places/tests/browser/browser_sidebarpanels_click.js b/browser/components/places/tests/browser/browser_sidebarpanels_click.js index dbab5cf59dda..64cfb0e1bb22 100644 --- a/browser/components/places/tests/browser/browser_sidebarpanels_click.js +++ b/browser/components/places/tests/browser/browser_sidebarpanels_click.js @@ -70,7 +70,7 @@ add_task(async function test_sidebarpanels_click() { is(tree.selectedNode.itemId, -1, "The selected node is not bookmarked"); }, cleanup(aCallback) { - return PlacesTestUtils.clearHistory(); + return PlacesUtils.history.clear(); }, sidebarName: HISTORY_SIDEBAR_ID, treeName: HISTORY_SIDEBAR_TREE_ID, diff --git a/browser/components/places/tests/chrome/test_bug549192.xul b/browser/components/places/tests/chrome/test_bug549192.xul index f09a8de8e981..d88db35ea69f 100644 --- a/browser/components/places/tests/chrome/test_bug549192.xul +++ b/browser/components/places/tests/chrome/test_bug549192.xul @@ -65,7 +65,7 @@ SimpleTest.waitForExplicitFinish(); (async function() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); // Add some visits. let timeInMicroseconds = PlacesUtils.toPRTime(Date.now() - 10000); @@ -134,7 +134,7 @@ } // Cleanup. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); })().then(() => SimpleTest.finish()); } ]]> diff --git a/browser/components/places/tests/chrome/test_bug549491.xul b/browser/components/places/tests/chrome/test_bug549491.xul index 777063715bb2..e12cd91b3986 100644 --- a/browser/components/places/tests/chrome/test_bug549491.xul +++ b/browser/components/places/tests/chrome/test_bug549491.xul @@ -48,7 +48,7 @@ SimpleTest.waitForExplicitFinish(); (async function() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesTestUtils.addVisits({ uri: Services.io.newURI("http://example.tld/"), @@ -71,7 +71,7 @@ ok(true, "No exceptions thrown"); // Cleanup. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); })().then(SimpleTest.finish); } ]]> diff --git a/browser/components/places/tests/chrome/test_treeview_date.xul b/browser/components/places/tests/chrome/test_treeview_date.xul index 7036b837c4e3..228ab7631961 100644 --- a/browser/components/places/tests/chrome/test_treeview_date.xul +++ b/browser/components/places/tests/chrome/test_treeview_date.xul @@ -58,7 +58,7 @@ } (async function() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let midnight = new Date(); midnight.setHours(0); @@ -151,7 +151,7 @@ // Cleanup. await PlacesUtils.bookmarks.remove(bm.guid); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); })().then(SimpleTest.finish); } ]]> diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js index 9b8375a96bfe..bd310cdb4f10 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js @@ -15,7 +15,7 @@ add_task(async function test() { // delete all cookies cm.removeAll(); // delete all history items - return PlacesTestUtils.clearHistory(); + return PlacesUtils.history.clear(); } await cleanup(); diff --git a/browser/modules/test/browser/browser_UsageTelemetry_content.js b/browser/modules/test/browser/browser_UsageTelemetry_content.js index 16d8945ccd02..6d78fe23d1ee 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry_content.js +++ b/browser/modules/test/browser/browser_UsageTelemetry_content.js @@ -35,7 +35,7 @@ add_task(async function setup() { Services.search.currentEngine = originalEngine; Services.search.removeEngine(engineDefault); Services.search.removeEngine(engineOneOff); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); Services.telemetry.setEventRecordingEnabled("navigation", false); }); }); diff --git a/browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js b/browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js index 3d271514b742..23ca4a5a5a2a 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js +++ b/browser/modules/test/browser/browser_UsageTelemetry_content_aboutHome.js @@ -35,7 +35,7 @@ add_task(async function setup() { Services.search.currentEngine = originalEngine; Services.search.removeEngine(engineDefault); Services.search.removeEngine(engineOneOff); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); Services.telemetry.setEventRecordingEnabled("navigation", false); Services.prefs.clearUserPref("browser.newtabpage.activity-stream.aboutHome.enabled"); }); diff --git a/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js b/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js index 97f4d037905f..e0164c99ff8b 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js +++ b/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js @@ -98,7 +98,7 @@ add_task(async function setup() { // Clear history so that history added by previous tests doesn't mess up this // test when it selects results in the urlbar. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); // Clear historical search suggestions to avoid interference from previous // tests. @@ -114,7 +114,7 @@ add_task(async function setup() { Services.search.removeEngine(engine); Services.prefs.setBoolPref(SUGGEST_URLBAR_PREF, suggestionsEnabled); Services.prefs.clearUserPref(ONEOFF_URLBAR_PREF); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); Services.telemetry.setEventRecordingEnabled("navigation", false); }); }); diff --git a/services/sync/tests/unit/test_history_engine.js b/services/sync/tests/unit/test_history_engine.js index 93d3ab46f7dc..27d606282fd7 100644 --- a/services/sync/tests/unit/test_history_engine.js +++ b/services/sync/tests/unit/test_history_engine.js @@ -128,7 +128,7 @@ add_task(async function test_history_download_limit() { deepEqual(ping.engines[0].incoming, { applied: 5 }); deepEqual(Array.from(engine.toFetch), []); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_history_visit_roundtrip() { @@ -183,7 +183,7 @@ add_task(async function test_history_visit_roundtrip() { // effectively `Math.round(microsecondTimestamp / 1000) * 1000`.) visits = await PlacesSyncUtils.history.fetchVisitsForURL("https://www.example.com"); equal(visits.length, 2); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_history_visit_dedupe_old() { @@ -248,5 +248,5 @@ add_task(async function test_history_visit_dedupe_old() { "Should contain the Dec. 4th visit"); ok(allVisits.find(x => x.date.getTime() === Date.UTC(2017, 11, 5)), "Should contain the Dec. 5th visit"); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/services/sync/tests/unit/test_history_store.js b/services/sync/tests/unit/test_history_store.js index 1861d98aabeb..4b9791074cfc 100644 --- a/services/sync/tests/unit/test_history_store.js +++ b/services/sync/tests/unit/test_history_store.js @@ -103,7 +103,7 @@ add_task(async function test_store() { date: new Date(TIMESTAMP1 / 1000), transition: Ci.nsINavHistoryService.TRANSITION_LINK, }]); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_store_create() { @@ -129,7 +129,7 @@ add_task(async function test_store_create() { date: new Date(TIMESTAMP3 / 1000), transition: Ci.nsINavHistoryService.TRANSITION_TYPED, }]); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_null_title() { @@ -153,7 +153,7 @@ add_task(async function test_null_title() { date: new Date(TIMESTAMP3 / 1000), transition: Ci.nsINavHistoryService.TRANSITION_TYPED, }]); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_invalid_records() { @@ -436,7 +436,7 @@ add_task(async function test_getAllIDs_filters_file_uris() { do_check_attribute_count(await store.getAllIDs(), 0); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_applyIncomingBatch_filters_file_uris() { @@ -458,5 +458,5 @@ add_task(async function test_applyIncomingBatch_filters_file_uris() { add_task(async function cleanup() { _("Clean up."); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/services/sync/tests/unit/test_history_tracker.js b/services/sync/tests/unit/test_history_tracker.js index 66c7a2210701..9833527c2c2d 100644 --- a/services/sync/tests/unit/test_history_tracker.js +++ b/services/sync/tests/unit/test_history_tracker.js @@ -53,7 +53,7 @@ async function resetTracker() { } async function cleanup() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await resetTracker(); await tracker.stop(); } diff --git a/toolkit/components/places/tests/PlacesTestUtils.jsm b/toolkit/components/places/tests/PlacesTestUtils.jsm index e525af5b05c1..0df5241ac49f 100644 --- a/toolkit/components/places/tests/PlacesTestUtils.jsm +++ b/toolkit/components/places/tests/PlacesTestUtils.jsm @@ -130,19 +130,6 @@ this.PlacesTestUtils = Object.freeze({ await Promise.all(faviconPromises); }, - /** - * Clear all history. - * - * @return {Promise} - * @resolves When history was cleared successfully. - * @rejects JavaScript exception. - * - * @deprecated New consumers should directly use PlacesUtils.history.clear(). - */ - clearHistory() { - return PlacesUtils.history.clear(); - }, - /** * Waits for all pending async statements on the default connection. * diff --git a/toolkit/components/places/tests/browser/browser_bug399606.js b/toolkit/components/places/tests/browser/browser_bug399606.js index 2ac0e057ba9a..78a264b0cdec 100644 --- a/toolkit/components/places/tests/browser/browser_bug399606.js +++ b/toolkit/components/places/tests/browser/browser_bug399606.js @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ add_task(async function() { - registerCleanupFunction(PlacesTestUtils.clearHistory); + registerCleanupFunction(PlacesUtils.history.clear); const URIS = [ "http://example.com/tests/toolkit/components/places/tests/browser/399606-window.location.href.html", diff --git a/toolkit/components/places/tests/browser/browser_bug461710.js b/toolkit/components/places/tests/browser/browser_bug461710.js index 0eadf130593f..5e2b78ae4d7b 100644 --- a/toolkit/components/places/tests/browser/browser_bug461710.js +++ b/toolkit/components/places/tests/browser/browser_bug461710.js @@ -4,7 +4,7 @@ const kBlue = "rgb(0, 0, 255)"; const prefix = "http://example.com/tests/toolkit/components/places/tests/browser/461710_"; add_task(async function() { - registerCleanupFunction(PlacesTestUtils.clearHistory); + registerCleanupFunction(PlacesUtils.history.clear); let contentPage = prefix + "iframe.html"; let normalWindow = await BrowserTestUtils.openNewBrowserWindow(); diff --git a/toolkit/components/places/tests/browser/browser_bug646422.js b/toolkit/components/places/tests/browser/browser_bug646422.js index e79e2de12819..493059e9d160 100644 --- a/toolkit/components/places/tests/browser/browser_bug646422.js +++ b/toolkit/components/places/tests/browser/browser_bug646422.js @@ -46,6 +46,6 @@ add_task(async function() { Assert.equal(args.newtitle, content.document.title, "Title after pushstate."); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); gBrowser.removeTab(tab); }); diff --git a/toolkit/components/places/tests/browser/browser_bug680727.js b/toolkit/components/places/tests/browser/browser_bug680727.js index 7ac4b552a51a..db92e1ba8dd0 100644 --- a/toolkit/components/places/tests/browser/browser_bug680727.js +++ b/toolkit/components/places/tests/browser/browser_bug680727.js @@ -97,7 +97,7 @@ function reloadListener() { function reloadAsyncListener(aURI, aIsVisited) { ok(kUniqueURI.equals(aURI) && aIsVisited, "We have visited the URI."); - PlacesTestUtils.clearHistory().then(finish); + PlacesUtils.history.clear().then(finish); } registerCleanupFunction(async function() { diff --git a/toolkit/components/places/tests/browser/browser_double_redirect.js b/toolkit/components/places/tests/browser/browser_double_redirect.js index 3db2ee48af48..5d447958df3f 100644 --- a/toolkit/components/places/tests/browser/browser_double_redirect.js +++ b/toolkit/components/places/tests/browser/browser_double_redirect.js @@ -3,7 +3,7 @@ // previous visit in the chain, not to the first visit in the chain. add_task(async function() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); const BASE_URL = "http://example.com/tests/toolkit/components/places/tests/browser/"; const TEST_URI = NetUtil.newURI(BASE_URL + "begin.html"); @@ -70,5 +70,5 @@ add_task(async function() { await promiseVisits; }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/places/tests/browser/browser_notfound.js b/toolkit/components/places/tests/browser/browser_notfound.js index 8ae21fe3d734..6cdfefc8663e 100644 --- a/toolkit/components/places/tests/browser/browser_notfound.js +++ b/toolkit/components/places/tests/browser/browser_notfound.js @@ -51,6 +51,6 @@ add_task(async function() { let newTabPromise = BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL); await Promise.all([visitedPromise, newTabPromise]); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); gBrowser.removeCurrentTab(); }); diff --git a/toolkit/components/places/tests/browser/browser_settitle.js b/toolkit/components/places/tests/browser/browser_settitle.js index 631a05bc368b..acec7f3d2908 100644 --- a/toolkit/components/places/tests/browser/browser_settitle.js +++ b/toolkit/components/places/tests/browser/browser_settitle.js @@ -66,6 +66,6 @@ add_task(async function() { }); gBrowser.removeCurrentTab(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/places/tests/browser/browser_visited_notfound.js b/toolkit/components/places/tests/browser/browser_visited_notfound.js index b6db5f60eaf4..2958bf24b3bf 100644 --- a/toolkit/components/places/tests/browser/browser_visited_notfound.js +++ b/toolkit/components/places/tests/browser/browser_visited_notfound.js @@ -7,7 +7,7 @@ add_task(async function test() { registerCleanupFunction(async function() { Services.prefs.clearUserPref("places.frecency.decayRate"); await BrowserTestUtils.removeTab(tab); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); // First add a visit to the page, this will ensure that later we skip diff --git a/toolkit/components/places/tests/browser/browser_visituri.js b/toolkit/components/places/tests/browser/browser_visituri.js index fa1c084192cb..5c556f1eebd2 100644 --- a/toolkit/components/places/tests/browser/browser_visituri.js +++ b/toolkit/components/places/tests/browser/browser_visituri.js @@ -76,7 +76,7 @@ add_task(async function() { await BrowserTestUtils.synthesizeMouseAtCenter("#clickme", { }, gBrowser.selectedBrowser); await visitUriPromise; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); gBrowser.removeCurrentTab(); }); diff --git a/toolkit/components/places/tests/browser/browser_visituri_nohistory.js b/toolkit/components/places/tests/browser/browser_visituri_nohistory.js index 5128854b9314..f4f1b8078900 100644 --- a/toolkit/components/places/tests/browser/browser_visituri_nohistory.js +++ b/toolkit/components/places/tests/browser/browser_visituri_nohistory.js @@ -35,6 +35,6 @@ add_task(async function() { let uri = subject.QueryInterface(Ci.nsIURI); is(uri.spec, FINAL_URL, "received expected visit"); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); gBrowser.removeCurrentTab(); }); diff --git a/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js b/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js index 4c5f8ed46ba8..ca599c763533 100644 --- a/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js +++ b/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js @@ -30,7 +30,7 @@ add_task(async function setup() { Services.obs.addObserver(observer, "uri-visit-saved"); registerCleanupFunction(async function() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); }); diff --git a/toolkit/components/places/tests/chrome/test_favicon_annotations.xul b/toolkit/components/places/tests/chrome/test_favicon_annotations.xul index 431acc1f8f29..f41732f4e588 100644 --- a/toolkit/components/places/tests/chrome/test_favicon_annotations.xul +++ b/toolkit/components/places/tests/chrome/test_favicon_annotations.xul @@ -90,7 +90,7 @@ function test() { SimpleTest.waitForExplicitFinish(); (async () => { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); info("Inserting new visit"); await PlacesUtils.history.insert({ diff --git a/toolkit/components/places/tests/expiration/test_clearHistory.js b/toolkit/components/places/tests/expiration/test_clearHistory.js index a3a4b6fbf62a..0e64bc367107 100644 --- a/toolkit/components/places/tests/expiration/test_clearHistory.js +++ b/toolkit/components/places/tests/expiration/test_clearHistory.js @@ -51,7 +51,7 @@ add_task(async function test_historyClear() { } // Expire all visits for the bookmarks - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); ["expire_session", "expire"].forEach(function(aAnno) { diff --git a/toolkit/components/places/tests/expiration/test_debug_expiration.js b/toolkit/components/places/tests/expiration/test_debug_expiration.js index 6f833531988d..5aa66f5be35e 100644 --- a/toolkit/components/places/tests/expiration/test_debug_expiration.js +++ b/toolkit/components/places/tests/expiration/test_debug_expiration.js @@ -37,7 +37,7 @@ add_task(async function test_expire_orphans() { Assert.ok(!page_in_database("http://page3.mozilla.org/")); // Clean up. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_expire_orphans_optionalarg() { @@ -67,7 +67,7 @@ add_task(async function test_expire_orphans_optionalarg() { Assert.ok(!page_in_database("http://page3.mozilla.org/")); // Clean up. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_expire_limited() { @@ -91,7 +91,7 @@ add_task(async function test_expire_limited() { Assert.ok(!page_in_database("http://old.mozilla.org/")); // Clean up. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_expire_limited_longurl() { @@ -119,7 +119,7 @@ add_task(async function test_expire_limited_longurl() { Assert.ok(!page_in_database("http://old.mozilla.org/")); // Clean up. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_expire_limited_exoticurl() { @@ -152,7 +152,7 @@ add_task(async function test_expire_limited_exoticurl() { Assert.ok(!page_in_database("http://old.mozilla.org/")); // Clean up. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_expire_unlimited() { @@ -205,7 +205,7 @@ add_task(async function test_expire_unlimited() { Assert.ok(!page_in_database("http://new.mozilla.org/")); // Clean up. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); function run_test() { diff --git a/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js b/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js index 7ee6205be5cf..a871d29c7344 100644 --- a/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js +++ b/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js @@ -101,10 +101,10 @@ add_task(async function test_notifications_onDeleteURI() { // Clean up. await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } clearMaxPages(); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js b/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js index f4bb9e343d30..932af76065e3 100644 --- a/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js +++ b/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js @@ -129,10 +129,10 @@ add_task(async function test_notifications_onDeleteVisits() { // Clean up. await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } clearMaxPages(); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/places/tests/expiration/test_pref_maxpages.js b/toolkit/components/places/tests/expiration/test_pref_maxpages.js index 05728a68f996..2bfe42f477f3 100644 --- a/toolkit/components/places/tests/expiration/test_pref_maxpages.js +++ b/toolkit/components/places/tests/expiration/test_pref_maxpages.js @@ -101,9 +101,9 @@ add_task(async function test_pref_maxpages() { currentTest.expectedNotifications); // Clean up. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } clearMaxPages(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/places/tests/favicons/test_copyFavicons.js b/toolkit/components/places/tests/favicons/test_copyFavicons.js index c364fcf25d3b..8e623a6f664c 100644 --- a/toolkit/components/places/tests/favicons/test_copyFavicons.js +++ b/toolkit/components/places/tests/favicons/test_copyFavicons.js @@ -67,7 +67,7 @@ add_task(async function test_copyFavicons_noop() { null, "Icon should not have been copied"); PlacesUtils.favicons.expireAllFavicons(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_copyFavicons() { @@ -101,7 +101,7 @@ add_task(async function test_copyFavicons() { SMALLSVG_DATA_URI.spec, "Large icon found"); PlacesUtils.favicons.expireAllFavicons(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_copyFavicons_overlap() { diff --git a/toolkit/components/places/tests/favicons/test_replaceFaviconData.js b/toolkit/components/places/tests/favicons/test_replaceFaviconData.js index e1d8c5d905c2..8032dba49a2a 100644 --- a/toolkit/components/places/tests/favicons/test_replaceFaviconData.js +++ b/toolkit/components/places/tests/favicons/test_replaceFaviconData.js @@ -83,7 +83,7 @@ add_task(async function test_replaceFaviconData_validHistoryURI() { }, systemPrincipal); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconData_overrideDefaultFavicon() { @@ -115,7 +115,7 @@ add_task(async function test_replaceFaviconData_overrideDefaultFavicon() { }, systemPrincipal); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconData_replaceExisting() { @@ -152,7 +152,7 @@ add_task(async function test_replaceFaviconData_replaceExisting() { }, systemPrincipal); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconData_unrelatedReplace() { @@ -184,7 +184,7 @@ add_task(async function test_replaceFaviconData_unrelatedReplace() { }, systemPrincipal); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconData_badInputs() { @@ -205,7 +205,7 @@ add_task(async function test_replaceFaviconData_badInputs() { /NS_ERROR_ILLEGAL_VALUE/); icon.file.remove(false); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconData_twiceReplace() { @@ -240,5 +240,5 @@ add_task(async function test_replaceFaviconData_twiceReplace() { }, systemPrincipal); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/places/tests/favicons/test_replaceFaviconDataFromDataURL.js b/toolkit/components/places/tests/favicons/test_replaceFaviconDataFromDataURL.js index b3e70a730889..84c8e392eaaa 100644 --- a/toolkit/components/places/tests/favicons/test_replaceFaviconDataFromDataURL.js +++ b/toolkit/components/places/tests/favicons/test_replaceFaviconDataFromDataURL.js @@ -85,7 +85,7 @@ add_task(async function test_replaceFaviconDataFromDataURL_validHistoryURI() { }, Services.scriptSecurityManager.getSystemPrincipal()); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconDataFromDataURL_overrideDefaultFavicon() { @@ -116,7 +116,7 @@ add_task(async function test_replaceFaviconDataFromDataURL_overrideDefaultFavico }, Services.scriptSecurityManager.getSystemPrincipal()); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconDataFromDataURL_replaceExisting() { @@ -150,7 +150,7 @@ add_task(async function test_replaceFaviconDataFromDataURL_replaceExisting() { }, Services.scriptSecurityManager.getSystemPrincipal()); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconDataFromDataURL_unrelatedReplace() { @@ -181,7 +181,7 @@ add_task(async function test_replaceFaviconDataFromDataURL_unrelatedReplace() { }, Services.scriptSecurityManager.getSystemPrincipal()); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconDataFromDataURL_badInputs() { @@ -211,7 +211,7 @@ add_task(async function test_replaceFaviconDataFromDataURL_badInputs() { favicon.file.remove(false); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconDataFromDataURL_twiceReplace() { @@ -244,7 +244,7 @@ add_task(async function test_replaceFaviconDataFromDataURL_twiceReplace() { }, Services.scriptSecurityManager.getSystemPrincipal()); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconDataFromDataURL_afterRegularAssign() { @@ -278,7 +278,7 @@ add_task(async function test_replaceFaviconDataFromDataURL_afterRegularAssign() }, Services.scriptSecurityManager.getSystemPrincipal()); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_replaceFaviconDataFromDataURL_beforeRegularAssign() { @@ -312,7 +312,7 @@ add_task(async function test_replaceFaviconDataFromDataURL_beforeRegularAssign() }, Services.scriptSecurityManager.getSystemPrincipal()); }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); /* toBase64 copied from image/test/unit/test_encoder_png.js */ diff --git a/toolkit/components/places/tests/history/test_async_history_api.js b/toolkit/components/places/tests/history/test_async_history_api.js index 57576e3c09b3..dc8422849a86 100644 --- a/toolkit/components/places/tests/history/test_async_history_api.js +++ b/toolkit/components/places/tests/history/test_async_history_api.js @@ -1087,7 +1087,7 @@ add_task(async function test_callbacks_not_supplied() { // Test that we don't wrongly overwrite typed and hidden when adding new visits. add_task(async function test_typed_hidden_not_overwritten() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let places = [ { uri: NetUtil.newURI("http://mozilla.org/"), title: "test", @@ -1117,7 +1117,7 @@ add_task(async function test_typed_hidden_not_overwritten() { }); add_task(async function test_omit_frecency_notifications() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let places = [ { uri: NetUtil.newURI("http://mozilla.org/"), title: "test", @@ -1150,7 +1150,7 @@ add_task(async function test_omit_frecency_notifications() { }); add_task(async function test_ignore_errors() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); // This test ensures that trying to add a visit, with a guid already found in // another visit, fails - but doesn't report if we told it not to. let place = { @@ -1191,7 +1191,7 @@ add_task(async function test_ignore_errors() { }); add_task(async function test_ignore_results() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let place = { uri: NetUtil.newURI("http://mozilla.org/"), title: "test", @@ -1210,7 +1210,7 @@ add_task(async function test_ignore_results() { }); add_task(async function test_ignore_results_and_errors() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); // This test ensures that trying to add a visit, with a guid already found in // another visit, fails - but doesn't report if we told it not to. let place = { diff --git a/toolkit/components/places/tests/history/test_fetch.js b/toolkit/components/places/tests/history/test_fetch.js index 9e3d202f7e33..4e458d5d8490 100644 --- a/toolkit/components/places/tests/history/test_fetch.js +++ b/toolkit/components/places/tests/history/test_fetch.js @@ -2,7 +2,7 @@ "use strict"; add_task(async function test_fetch_existent() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); // Populate places and historyvisits. @@ -78,7 +78,7 @@ add_task(async function test_fetch_existent() { }); add_task(async function test_fetch_page_meta_info() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let TEST_URI = NetUtil.newURI("http://mozilla.com/test_fetch_page_meta_info"); await PlacesTestUtils.addVisits(TEST_URI); @@ -107,7 +107,7 @@ add_task(async function test_fetch_page_meta_info() { }); add_task(async function test_fetch_nonexistent() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); let uri = NetUtil.newURI("http://doesntexist.in.db"); diff --git a/toolkit/components/places/tests/history/test_hasVisits.js b/toolkit/components/places/tests/history/test_hasVisits.js index 6fbeb31d4a53..e3da9f188b76 100644 --- a/toolkit/components/places/tests/history/test_hasVisits.js +++ b/toolkit/components/places/tests/history/test_hasVisits.js @@ -26,7 +26,7 @@ add_task(async function test_has_visits_error_cases() { add_task(async function test_history_has_visits() { const TEST_URL = "http://mozilla.com/"; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); Assert.equal(await PlacesUtils.history.hasVisits(TEST_URL), false, "Test Url should not be in history."); Assert.equal(await PlacesUtils.history.hasVisits(Services.io.newURI(TEST_URL)), @@ -39,5 +39,5 @@ add_task(async function test_history_has_visits() { let guid = await PlacesTestUtils.fieldInDB(TEST_URL, "guid"); Assert.equal(await PlacesUtils.history.hasVisits(guid), true, "Test Url should be in history."); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/places/tests/history/test_insert.js b/toolkit/components/places/tests/history/test_insert.js index 3c69232fe416..6c1581a0b2a2 100644 --- a/toolkit/components/places/tests/history/test_insert.js +++ b/toolkit/components/places/tests/history/test_insert.js @@ -146,6 +146,6 @@ add_task(async function test_history_insert() { } } } finally { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } }); diff --git a/toolkit/components/places/tests/history/test_insertMany.js b/toolkit/components/places/tests/history/test_insertMany.js index 5f5e591da191..deaff35cc3fd 100644 --- a/toolkit/components/places/tests/history/test_insertMany.js +++ b/toolkit/components/places/tests/history/test_insertMany.js @@ -71,7 +71,7 @@ add_task(async function test_insertMany() { info(name); info(`filter: ${filter}`); info(`useCallbacks: ${useCallbacks}`); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let result; let allUrls = GOOD_URLS.concat(BAD_URLS); @@ -124,7 +124,7 @@ add_task(async function test_insertMany() { Assert.equal("No items were added to history.", error.message, "History.insertMany rejected promise with all bad URLs"); }); } finally { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } }); diff --git a/toolkit/components/places/tests/history/test_remove.js b/toolkit/components/places/tests/history/test_remove.js index 110dfa987496..7c345d2cc5ad 100644 --- a/toolkit/components/places/tests/history/test_remove.js +++ b/toolkit/components/places/tests/history/test_remove.js @@ -10,7 +10,7 @@ Cu.importGlobalProperties(["URL"]); // Test removing a single page add_task(async function test_remove_single() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); @@ -131,12 +131,12 @@ add_task(async function test_remove_single() { } } } finally { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } }); add_task(async function cleanup() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); }); diff --git a/toolkit/components/places/tests/history/test_removeByFilter.js b/toolkit/components/places/tests/history/test_removeByFilter.js index d92f058ee7df..4797c8812b16 100644 --- a/toolkit/components/places/tests/history/test_removeByFilter.js +++ b/toolkit/components/places/tests/history/test_removeByFilter.js @@ -20,7 +20,7 @@ add_task(async function test_removeByFilter() { // Cleanup - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); // Adding a witness URI diff --git a/toolkit/components/places/tests/history/test_removeMany.js b/toolkit/components/places/tests/history/test_removeMany.js index fad903fbe496..c3dec8c4669b 100644 --- a/toolkit/components/places/tests/history/test_removeMany.js +++ b/toolkit/components/places/tests/history/test_removeMany.js @@ -11,7 +11,7 @@ add_task(async function test_remove_many() { // This is set so that we are guaranteed to trigger REMOVE_PAGES_CHUNKLEN. const SIZE = 310; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); info("Adding a witness page"); @@ -143,6 +143,6 @@ add_task(async function test_remove_many() { }); add_task(async function cleanup() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); }); diff --git a/toolkit/components/places/tests/history/test_removeVisits.js b/toolkit/components/places/tests/history/test_removeVisits.js index bd1bb24cb735..e86f341f583d 100644 --- a/toolkit/components/places/tests/history/test_removeVisits.js +++ b/toolkit/components/places/tests/history/test_removeVisits.js @@ -3,7 +3,7 @@ const DB_NOW = JS_NOW * 1000; const TEST_URI = uri("http://example.com/"); async function cleanup() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); // This is needed to remove place: entries. DBConn().executeSimpleSQL("DELETE FROM moz_places"); diff --git a/toolkit/components/places/tests/history/test_removeVisitsByFilter.js b/toolkit/components/places/tests/history/test_removeVisitsByFilter.js index c2f3d23a2726..7bae4fe74886 100644 --- a/toolkit/components/places/tests/history/test_removeVisitsByFilter.js +++ b/toolkit/components/places/tests/history/test_removeVisitsByFilter.js @@ -18,7 +18,7 @@ add_task(async function test_removeVisitsByFilter() { info("Remover with options " + JSON.stringify(options)); let SAMPLE_SIZE = options.sampleSize; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); // Populate the database. @@ -258,7 +258,7 @@ add_task(async function test_removeVisitsByFilter() { await remover(options); } } - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); // Test the various error cases diff --git a/toolkit/components/places/tests/history/test_update.js b/toolkit/components/places/tests/history/test_update.js index 2bf10faa0356..52d814e04388 100644 --- a/toolkit/components/places/tests/history/test_update.js +++ b/toolkit/components/places/tests/history/test_update.js @@ -68,7 +68,7 @@ add_task(async function test_error_cases() { }); add_task(async function test_description_change_saved() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let TEST_URL = "http://mozilla.org/test_description_change_saved"; await PlacesTestUtils.addVisits(TEST_URL); @@ -102,7 +102,7 @@ add_task(async function test_description_change_saved() { }); add_task(async function test_previewImageURL_change_saved() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let TEST_URL = "http://mozilla.org/test_previewImageURL_change_saved"; let IMAGE_URL = "http://mozilla.org/test_preview_image.png"; @@ -127,7 +127,7 @@ add_task(async function test_previewImageURL_change_saved() { }); add_task(async function test_change_both_saved() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let TEST_URL = "http://mozilla.org/test_change_both_saved"; await PlacesTestUtils.addVisits(TEST_URL); diff --git a/toolkit/components/places/tests/queries/test_history_queries_titles_liveUpdate.js b/toolkit/components/places/tests/queries/test_history_queries_titles_liveUpdate.js index cfeff99dd732..a941f1aea7d0 100644 --- a/toolkit/components/places/tests/queries/test_history_queries_titles_liveUpdate.js +++ b/toolkit/components/places/tests/queries/test_history_queries_titles_liveUpdate.js @@ -68,7 +68,7 @@ add_task(async function pages_query() { } root.containerOpen = false; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function visits_query() { @@ -94,7 +94,7 @@ add_task(async function visits_query() { } root.containerOpen = false; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function pages_searchterm_query() { @@ -117,7 +117,7 @@ add_task(async function pages_searchterm_query() { } root.containerOpen = false; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function visits_searchterm_query() { @@ -143,7 +143,7 @@ add_task(async function visits_searchterm_query() { } root.containerOpen = false; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function pages_searchterm_is_title_query() { @@ -168,7 +168,7 @@ add_task(async function pages_searchterm_is_title_query() { } root.containerOpen = false; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function visits_searchterm_is_title_query() { @@ -199,5 +199,5 @@ add_task(async function visits_searchterm_is_title_query() { } root.containerOpen = false; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/places/tests/queries/test_redirects.js b/toolkit/components/places/tests/queries/test_redirects.js index 3642d2c0e949..6ea234d2a0af 100644 --- a/toolkit/components/places/tests/queries/test_redirects.js +++ b/toolkit/components/places/tests/queries/test_redirects.js @@ -298,5 +298,5 @@ add_task(async function test_redirects() { await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/places/tests/queries/test_sorting.js b/toolkit/components/places/tests/queries/test_sorting.js index 9555e7251871..ba676b2beecb 100644 --- a/toolkit/components/places/tests/queries/test_sorting.js +++ b/toolkit/components/places/tests/queries/test_sorting.js @@ -1254,6 +1254,6 @@ add_task(async function test_sorting() { test.check_reverse(); // Execute cleanup tasks await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } }); diff --git a/toolkit/components/places/tests/queries/test_tags.js b/toolkit/components/places/tests/queries/test_tags.js index 9b4a3e932f41..70dafcb41cc9 100644 --- a/toolkit/components/places/tests/queries/test_tags.js +++ b/toolkit/components/places/tests/queries/test_tags.js @@ -607,7 +607,7 @@ function addBookmark(aURI) { */ async function task_cleanDatabase(aCallback) { await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } /** diff --git a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js index f66f6b344f79..631142e4ba1c 100644 --- a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js +++ b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js @@ -36,7 +36,7 @@ async function cleanup() { } Services.prefs.clearUserPref("browser.search.suggest.enabled"); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } registerCleanupFunction(cleanup); diff --git a/toolkit/components/places/tests/unit/test_317472.js b/toolkit/components/places/tests/unit/test_317472.js index a5ddbe94db71..f33788b9b69c 100644 --- a/toolkit/components/places/tests/unit/test_317472.js +++ b/toolkit/components/places/tests/unit/test_317472.js @@ -41,7 +41,7 @@ add_task(async function test_execute() { // get charset from bookmarked page Assert.equal((await PlacesUtils.getCharsetForURI(TEST_BOOKMARKED_URI)), charset); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); // ensure that charset has gone for not-bookmarked page Assert.notEqual((await PlacesUtils.getCharsetForURI(TEST_URI)), charset); diff --git a/toolkit/components/places/tests/unit/test_412132.js b/toolkit/components/places/tests/unit/test_412132.js index 16382339ca51..41591b94e218 100644 --- a/toolkit/components/places/tests/unit/test_412132.js +++ b/toolkit/components/places/tests/unit/test_412132.js @@ -41,7 +41,7 @@ add_task(async function changeuri_unvisited_bookmark() { "Unvisited URI no longer bookmarked => frecency should = 0"); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function changeuri_visited_bookmark() { @@ -73,7 +73,7 @@ add_task(async function changeuri_visited_bookmark() { "*Visited* URI no longer bookmarked => frecency should != 0"); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function changeuri_bookmark_still_bookmarked() { @@ -108,7 +108,7 @@ add_task(async function changeuri_bookmark_still_bookmarked() { Assert.notEqual(frecencyForUrl(TEST_URL2), 0); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function changeuri_nonexistent_bookmark() { @@ -135,5 +135,5 @@ add_task(async function changeuri_nonexistent_bookmark() { "Changing the URI of a non-existent bookmark should fail."); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/places/tests/unit/test_adaptive.js b/toolkit/components/places/tests/unit/test_adaptive.js index 3421b11edb47..c5a115ebd379 100644 --- a/toolkit/components/places/tests/unit/test_adaptive.js +++ b/toolkit/components/places/tests/unit/test_adaptive.js @@ -390,7 +390,7 @@ add_task(async function test_adaptive() { Services.prefs.clearUserPref("browser.urlbar.suggest." + type); } - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let resultsCompletedPromise = promiseResultsCompleted(); await test(); diff --git a/toolkit/components/places/tests/unit/test_asyncExecuteLegacyQueries.js b/toolkit/components/places/tests/unit/test_asyncExecuteLegacyQueries.js index 7d43e4c788d4..967e0309e1f1 100644 --- a/toolkit/components/places/tests/unit/test_asyncExecuteLegacyQueries.js +++ b/toolkit/components/places/tests/unit/test_asyncExecuteLegacyQueries.js @@ -75,7 +75,7 @@ add_task(async function test_bookmarks_query() { function cleanupTest() { return Promise.all([ - PlacesTestUtils.clearHistory(), + PlacesUtils.history.clear(), PlacesUtils.bookmarks.eraseEverything() ]); } diff --git a/toolkit/components/places/tests/unit/test_browserhistory.js b/toolkit/components/places/tests/unit/test_browserhistory.js index e59ef14be9b2..aa7619a2e742 100644 --- a/toolkit/components/places/tests/unit/test_browserhistory.js +++ b/toolkit/components/places/tests/unit/test_browserhistory.js @@ -58,7 +58,7 @@ add_task(async function test_removePages() { // Cleanup. await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_removePagesByTimeframe() { @@ -100,7 +100,7 @@ add_task(async function test_removePagesFromHost_keepSubdomains() { }); add_task(async function test_history_clear() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); Assert.equal(0, PlacesUtils.history.hasHistoryEntries); }); diff --git a/toolkit/components/places/tests/unit/test_download_history.js b/toolkit/components/places/tests/unit/test_download_history.js index 161e42d022f0..e955719320a7 100644 --- a/toolkit/components/places/tests/unit/test_download_history.js +++ b/toolkit/components/places/tests/unit/test_download_history.js @@ -120,7 +120,7 @@ add_test(function test_dh_addMultiRemoveDownload() { Assert.ok(aDeletedURI.equals(DOWNLOAD_URI)); Assert.ok(!!page_in_database(DOWNLOAD_URI)); - PlacesTestUtils.clearHistory().then(run_next_test); + PlacesUtils.history.clear().then(run_next_test); }); gDownloadHistory.removeAllDownloads(); }); @@ -145,7 +145,7 @@ add_task(async function test_dh_addBookmarkRemoveDownload() { Assert.ok(aDeletedURI.equals(DOWNLOAD_URI)); Assert.ok(!!page_in_database(DOWNLOAD_URI)); - PlacesTestUtils.clearHistory().then(resolve); + PlacesUtils.history.clear().then(resolve); }); gDownloadHistory.removeAllDownloads(); }); @@ -167,7 +167,7 @@ add_test(function test_dh_addDownload_referrer() { // Verify that the URI is already available in results at this time. Assert.ok(!!page_in_database(DOWNLOAD_URI)); - PlacesTestUtils.clearHistory().then(run_next_test); + PlacesUtils.history.clear().then(run_next_test); }); gDownloadHistory.addDownload(DOWNLOAD_URI, REFERRER_URI, Date.now() * 1000); @@ -195,7 +195,7 @@ add_test(function test_dh_addDownload_disabledHistory() { Assert.ok(!!page_in_database(DOWNLOAD_URI)); Assert.ok(!page_in_database(PRIVATE_URI)); - PlacesTestUtils.clearHistory().then(run_next_test); + PlacesUtils.history.clear().then(run_next_test); }); Services.prefs.setBoolPref("places.history.enabled", false); @@ -228,7 +228,7 @@ add_test(function test_dh_details() { PlacesUtils.annotations.removeObserver(annoObserver); PlacesUtils.history.removeObserver(historyObserver); - PlacesTestUtils.clearHistory().then(run_next_test); + PlacesUtils.history.clear().then(run_next_test); } } diff --git a/toolkit/components/places/tests/unit/test_frecency.js b/toolkit/components/places/tests/unit/test_frecency.js index 4a63b889633b..9e301912aeb8 100644 --- a/toolkit/components/places/tests/unit/test_frecency.js +++ b/toolkit/components/places/tests/unit/test_frecency.js @@ -273,7 +273,7 @@ add_task(async function test_frecency() { Services.prefs.setBoolPref("browser.urlbar.suggest.openpage", false); for (let test of tests) { await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await test(); } diff --git a/toolkit/components/places/tests/unit/test_frecency_observers.js b/toolkit/components/places/tests/unit/test_frecency_observers.js index 20dbef57b4ac..432cc9b88b77 100644 --- a/toolkit/components/places/tests/unit/test_frecency_observers.js +++ b/toolkit/components/places/tests/unit/test_frecency_observers.js @@ -45,7 +45,7 @@ add_task(async function test_nsNavHistory_invalidateFrecencies_somePages() { // nsNavHistory::invalidateFrecencies for all pages add_task(async function test_nsNavHistory_invalidateFrecencies_allPages() { - await Promise.all([onManyFrecenciesChanged(), PlacesTestUtils.clearHistory()]); + await Promise.all([onManyFrecenciesChanged(), PlacesUtils.history.clear()]); }); // nsNavHistory::DecayFrecency and nsNavHistory::FixInvalidFrecencies diff --git a/toolkit/components/places/tests/unit/test_hosts_triggers.js b/toolkit/components/places/tests/unit/test_hosts_triggers.js index aa58d56ba657..ee5565851989 100644 --- a/toolkit/components/places/tests/unit/test_hosts_triggers.js +++ b/toolkit/components/places/tests/unit/test_hosts_triggers.js @@ -121,7 +121,7 @@ add_task(async function test_bookmark_changes() { url: NEW_URL, }); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); let newUri = NetUtil.newURI(NEW_URL); Assert.ok(isHostInMozPlaces(newUri)); @@ -137,7 +137,7 @@ add_task(async function test_bookmark_removal() { unfiledBookmarksRoot.getChild(unfiledBookmarksRoot.childCount - 1).bookmarkGuid; await PlacesUtils.bookmarks.remove(itemGuid); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); checkHostNotInMozHosts(Services.io.newURI(NEW_URL), false, null); }); @@ -155,7 +155,7 @@ add_task(async function test_moz_hosts_typed_update() { await PlacesTestUtils.addVisits(places); checkHostInMozHosts(TEST_URI, true, null); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_moz_hosts_www_remove() { @@ -184,7 +184,7 @@ add_task(async function test_moz_hosts_www_remove() { const TEST_WWW_URI = NetUtil.newURI("http://www.rem.mozilla.com"); await test_removal(TEST_URI, TEST_WWW_URI); await test_removal(TEST_WWW_URI, TEST_URI); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_moz_hosts_ftp_matchall() { diff --git a/toolkit/components/places/tests/unit/test_isURIVisited.js b/toolkit/components/places/tests/unit/test_isURIVisited.js index eed7ba31baad..b70c24358479 100644 --- a/toolkit/components/places/tests/unit/test_isURIVisited.js +++ b/toolkit/components/places/tests/unit/test_isURIVisited.js @@ -56,7 +56,7 @@ function* step() { Assert.ok(uri.equals(aURI2)); Assert.ok(SCHEMES[scheme] ? aIsVisited2 : !aIsVisited2); - PlacesTestUtils.clearHistory().then(function() { + PlacesUtils.history.clear().then(function() { history.isURIVisited(uri, function(aURI3, aIsVisited3) { Assert.ok(uri.equals(aURI3)); Assert.ok(!aIsVisited3); diff --git a/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js b/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js index b1611eb8ee36..8b8d494b6a2c 100644 --- a/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js +++ b/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js @@ -120,7 +120,7 @@ add_test(function check_history_query() { Assert.equal(resultObserver.invalidatedContainer, result.root); // nsINavHistoryResultObserver.invalidateContainer - PlacesTestUtils.clearHistory().then(() => { + PlacesUtils.history.clear().then(() => { Assert.equal(root.uri, resultObserver.invalidatedContainer.uri); // nsINavHistoryResultObserver.batching diff --git a/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js b/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js index e1081d4f1b61..5398b515ed59 100644 --- a/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js +++ b/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js @@ -134,7 +134,7 @@ add_task(async function test_addVisitAndCheckGuid() { Assert.equal(root.getChild(0).bookmarkGuid, ""); root.containerOpen = false; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_addItemsWithInvalidGUIDsFails() { diff --git a/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js b/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js index 6c76e8f28b64..0d0210068dc0 100644 --- a/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js +++ b/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js @@ -59,7 +59,7 @@ add_task(async function test_addVisitCheckFields() { root.containerOpen = false; - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_bookmarkFields() { diff --git a/toolkit/components/places/tests/unit/test_sync_utils.js b/toolkit/components/places/tests/unit/test_sync_utils.js index 890c8f1d2e5b..0cd996d7359d 100644 --- a/toolkit/components/places/tests/unit/test_sync_utils.js +++ b/toolkit/components/places/tests/unit/test_sync_utils.js @@ -181,7 +181,7 @@ add_task(async function test_fetchURLFrecency() { } // Remove the visits added during this test. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_determineNonSyncableGuids() { @@ -215,7 +215,7 @@ add_task(async function test_determineNonSyncableGuids() { } // Remove the visits added during this test. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_changeGuid() { @@ -241,7 +241,7 @@ add_task(async function test_changeGuid() { } // Remove the visits added during this test. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_fetchVisitsForURL() { @@ -272,7 +272,7 @@ add_task(async function test_fetchVisitsForURL() { } // Remove the visits added during this test. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_fetchGuidForURL() { @@ -299,7 +299,7 @@ add_task(async function test_fetchGuidForURL() { } // Remove the visits added during this test. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_fetchURLInfoForGuid() { @@ -330,7 +330,7 @@ add_task(async function test_fetchURLInfoForGuid() { equal(info, null, "The information object of a non-existent guid should be null."); // Remove the visits added during this test. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_getAllURLs() { @@ -352,7 +352,7 @@ add_task(async function test_getAllURLs() { } // Remove the visits added during this test. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function test_order() { diff --git a/toolkit/components/places/tests/unit/test_update_frecency_after_delete.js b/toolkit/components/places/tests/unit/test_update_frecency_after_delete.js index 5f3ca9eb71f7..26ce94e7fd8d 100644 --- a/toolkit/components/places/tests/unit/test_update_frecency_after_delete.js +++ b/toolkit/components/places/tests/unit/test_update_frecency_after_delete.js @@ -33,7 +33,7 @@ add_task(async function removed_bookmark() { Assert.equal(frecencyForUrl(TEST_URI), 0); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function removed_but_visited_bookmark() { @@ -58,7 +58,7 @@ add_task(async function removed_but_visited_bookmark() { Assert.notEqual(frecencyForUrl(TEST_URI), 0); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function remove_bookmark_still_bookmarked() { @@ -87,7 +87,7 @@ add_task(async function remove_bookmark_still_bookmarked() { Assert.notEqual(frecencyForUrl(TEST_URI), 0); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function cleared_parent_of_visited_bookmark() { @@ -112,7 +112,7 @@ add_task(async function cleared_parent_of_visited_bookmark() { Assert.notEqual(frecencyForUrl(TEST_URI), 0); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); add_task(async function cleared_parent_of_bookmark_still_bookmarked() { @@ -147,5 +147,5 @@ add_task(async function cleared_parent_of_bookmark_still_bookmarked() { Assert.notEqual(frecencyForUrl(TEST_URI), 0); await PlacesUtils.bookmarks.eraseEverything(); - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); }); diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_topsites.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_topsites.js index 7727ef20493f..483d42a49c80 100644 --- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_topsites.js +++ b/toolkit/components/thumbnails/test/browser_thumbnails_bg_topsites.js @@ -38,5 +38,5 @@ function* runTests() { // Clean up NewTabUtils.pinnedLinks.unpin(pinnedSite); - yield PlacesTestUtils.clearHistory(); + yield PlacesUtils.history.clear(); } diff --git a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js index 97d2c03d50c0..02281652eddb 100644 --- a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js +++ b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js @@ -212,7 +212,7 @@ async function test_history_not_cleared_with_uri_contains_domain() { Assert.ok(await PlacesUtils.history.hasVisits(TEST_URI)); // Clear history since we left something there from this test. - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); } // Cookie Service diff --git a/toolkit/modules/tests/xpcshell/head.js b/toolkit/modules/tests/xpcshell/head.js index ba8250e1f535..99e3b21dbf56 100644 --- a/toolkit/modules/tests/xpcshell/head.js +++ b/toolkit/modules/tests/xpcshell/head.js @@ -33,7 +33,7 @@ function isVisitDateOK(timestampMS) { // a set up function to prep the activity stream provider function setUpActivityStreamTest() { return (async function() { - await PlacesTestUtils.clearHistory(); + await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); let faviconExpiredPromise = new Promise(resolve => { Services.obs.addObserver(resolve, "places-favicons-expired");