зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1113178 - Replace removeAllPages() in toolkit/components/social/ r=mak
This commit is contained in:
Родитель
23ea5d2142
Коммит
12b50e7601
|
@ -205,22 +205,3 @@ function promiseAddVisits(aPlaceInfo)
|
|||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function promiseTopicObserved(aTopic)
|
||||
{
|
||||
let deferred = Promise.defer();
|
||||
|
||||
Services.obs.addObserver(
|
||||
function PTO_observe(aSubject, aTopic, aData) {
|
||||
Services.obs.removeObserver(PTO_observe, aTopic);
|
||||
deferred.resolve([aSubject, aData]);
|
||||
}, aTopic, false);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function promiseClearHistory() {
|
||||
let promise = promiseTopicObserved(PlacesUtils.TOPIC_EXPIRATION_FINISHED);
|
||||
do_execute_soon(function() PlacesUtils.bhistory.removeAllPages());
|
||||
return promise;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
|
||||
"resource://testing-common/PlacesTestUtils.jsm");
|
||||
|
||||
function run_test() {
|
||||
initApp();
|
||||
|
@ -161,6 +163,6 @@ function testOrderedProviders(manifests, next) {
|
|||
do_check_eq(orderedProviders[0], providers[1]);
|
||||
do_check_eq(orderedProviders[1], providers[0]);
|
||||
do_check_true(orderedProviders[0].frecency > orderedProviders[1].frecency);
|
||||
promiseClearHistory().then(next);
|
||||
PlacesTestUtils.clearHistory().then(next);
|
||||
yield;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче