Bug 1434262 - Remove PlacesTestUtils.clearHistory() r=mak

MozReview-Commit-ID: In2RaM0LBsc

--HG--
extra : rebase_source : 0cb5dc65a53bfa384b93fb2a8c2af67ad9d3fe1c
This commit is contained in:
Nathan Watson 2018-01-31 22:03:05 -08:00
parent 3e6c3274c7
commit 1605552221
101 changed files with 188 additions and 203 deletions

View File

@ -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({

View File

@ -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);

View File

@ -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();
});

View File

@ -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();
});

View File

@ -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();

View File

@ -966,7 +966,7 @@ async function blankSlate() {
});
});
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
}
/**

View File

@ -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);
});

View File

@ -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();
});

View File

@ -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();

View File

@ -24,5 +24,5 @@ add_task(async function test_switchtab_decodeuri() {
});
gBrowser.removeCurrentTab();
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
});

View File

@ -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() {

View File

@ -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) {

View File

@ -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);

View File

@ -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");

View File

@ -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++) {

View File

@ -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);
});

View File

@ -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();

View File

@ -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();

View File

@ -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();
});

View File

@ -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);

View File

@ -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();
});
}

View File

@ -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");

View File

@ -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() {

View File

@ -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.

View File

@ -336,7 +336,7 @@ gTests.push({
delete this._removeObserver;
await PlacesTestUtils.promiseAsyncUpdates();
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
}
});

View File

@ -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");

View File

@ -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");

View File

@ -24,7 +24,7 @@ add_task(async function() {
await testForgetThisSiteVisibility(2);
// Cleanup.
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
});
var testForgetThisSiteVisibility = async function(selectionCount) {

View File

@ -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) {

View File

@ -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() {

View File

@ -10,7 +10,7 @@
registerCleanupFunction(async function() {
await PlacesUtils.bookmarks.eraseEverything();
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
});
add_task(async function test_tags() {

View File

@ -10,7 +10,7 @@
registerCleanupFunction(async function() {
await PlacesUtils.bookmarks.eraseEverything();
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
});
add_task(async function test_tags() {

View File

@ -51,7 +51,7 @@ function test() {
}
win.close();
PlacesTestUtils.clearHistory().then(finish);
PlacesUtils.history.clear().then(finish);
}
});
};

View File

@ -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();

View File

@ -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) {

View File

@ -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,

View File

@ -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());
}
]]></script>

View File

@ -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);
}
]]></script>

View File

@ -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);
}
]]>

View File

@ -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();

View File

@ -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);
});
});

View File

@ -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");
});

View File

@ -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);
});
});

View File

@ -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();
});

View File

@ -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();
});

View File

@ -53,7 +53,7 @@ async function resetTracker() {
}
async function cleanup() {
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
await resetTracker();
await tracker.stop();
}

View File

@ -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.
*

View File

@ -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",

View File

@ -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();

View File

@ -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);
});

View File

@ -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() {

View File

@ -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();
});

View File

@ -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();
});

View File

@ -66,6 +66,6 @@ add_task(async function() {
});
gBrowser.removeCurrentTab();
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
});

View File

@ -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

View File

@ -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();
});

View File

@ -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();
});

View File

@ -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();
});
});

View File

@ -90,7 +90,7 @@ function test()
{
SimpleTest.waitForExplicitFinish();
(async () => {
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
info("Inserting new visit");
await PlacesUtils.history.insert({

View File

@ -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) {

View File

@ -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() {

View File

@ -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();
});

View File

@ -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();
});

View File

@ -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();
});

View File

@ -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() {

View File

@ -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();
});

View File

@ -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 */

View File

@ -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 = {

View File

@ -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");

View File

@ -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();
});

View File

@ -146,6 +146,6 @@ add_task(async function test_history_insert() {
}
}
} finally {
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
}
});

View File

@ -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();
}
});

View File

@ -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();
});

View File

@ -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

View File

@ -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();
});

View File

@ -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");

View File

@ -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

View File

@ -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);

View File

@ -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();
});

View File

@ -298,5 +298,5 @@ add_task(async function test_redirects() {
await PlacesUtils.bookmarks.eraseEverything();
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
});

View File

@ -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();
}
});

View File

@ -607,7 +607,7 @@ function addBookmark(aURI) {
*/
async function task_cleanDatabase(aCallback) {
await PlacesUtils.bookmarks.eraseEverything();
await PlacesTestUtils.clearHistory();
await PlacesUtils.history.clear();
}
/**

View File

@ -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);

View File

@ -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);

View File

@ -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();
});

View File

@ -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();

View File

@ -75,7 +75,7 @@ add_task(async function test_bookmarks_query() {
function cleanupTest() {
return Promise.all([
PlacesTestUtils.clearHistory(),
PlacesUtils.history.clear(),
PlacesUtils.bookmarks.eraseEverything()
]);
}

View File

@ -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);
});

View File

@ -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);
}
}

View File

@ -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();
}

View File

@ -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

View File

@ -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() {

View File

@ -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);

View File

@ -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

View File

@ -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() {

View File

@ -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() {

View File

@ -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() {

View File

@ -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();
});

View File

@ -38,5 +38,5 @@ function* runTests() {
// Clean up
NewTabUtils.pinnedLinks.unpin(pinnedSite);
yield PlacesTestUtils.clearHistory();
yield PlacesUtils.history.clear();
}

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More