B2G/gecko/browser/components/places/tests/browser/head.js
/**
 * Waits for completion of a clear history operation, before
 * proceeding with aCallback.
 *
 * @param aCallback
 *        Function to be called when done.
 */
Waits for completion of a clear history operation, before
proceeding with aCallback.

@param aCallback
Function to be called when done.
Waits for completion of a clear history operation before proceeding with aCallback . @param aCallback Function to be called when done .
function waitForClearHistory(aCallback) {
  Services.obs.addObserver(function observeCH(aSubject, aTopic, aData) {
    Services.obs.removeObserver(observeCH, PlacesUtils.TOPIC_EXPIRATION_FINISHED);
    aCallback();
  }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
  PlacesUtils.bhistory.removeAllPages();
}
function waitForClearHistory ( aCallback ) { Services . obs . addObserver ( function observeCH ( aSubject , aTopic , aData ) { Services . obs . removeObserver ( observeCH , PlacesUtils . TOPIC_EXPIRATION_FINISHED ) ; aCallback ( ) ; } , PlacesUtils . TOPIC_EXPIRATION_FINISHED , false ) ; PlacesUtils . bhistory . removeAllPages ( ) ; }
Waits for completion of a clear history operation, before
 proceeding with aCallback.
Waits for completion of a clear history operation before proceeding with aCallback .