B2G/gecko/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
/*
 * Check an initialized cache by checking the cache, then restarting the
 * manager, and checking the cache. This checks that the cache is consistent
 * across manager restarts.
 *
 * @param  aExpectedToFind
 *         An array of booleans representing which REPOSITORY_ADDONS are
 *         expected to be found in the cache
 * @param  aCallback
 *         A callback to call once the checks are complete
 */
Check an initialized cache by checking the cache, then restarting the
manager, and checking the cache. This checks that the cache is consistent
across manager restarts.

@param  aExpectedToFind
An array of booleans representing which REPOSITORY_ADDONS are
expected to be found in the cache
@param  aCallback
A callback to call once the checks are complete
Check an initialized cache by checking the cache then restarting the manager and checking the cache . This checks that the cache is consistent across manager restarts . @param aExpectedToFind An array of booleans representing which REPOSITORY_ADDONS are expected to be found in the cache @param aCallback A callback to call once the checks are complete
function check_initialized_cache(aExpectedToFind, aCallback) {
  check_cache(aExpectedToFind, true, function() {
    restartManager();
    let cacheEnabled = Services.prefs.getBoolPref(PREF_GETADDONS_CACHE_ENABLED);
    check_cache(aExpectedToFind, !cacheEnabled, aCallback);
  });
}
function check_initialized_cache ( aExpectedToFind , aCallback ) { check_cache ( aExpectedToFind , true , function ( ) { restartManager ( ) ; let cacheEnabled = Services . prefs . getBoolPref ( PREF_GETADDONS_CACHE_ENABLED ) ; check_cache ( aExpectedToFind , ! cacheEnabled , aCallback ) ; } ) ; }
Check an initialized cache by checking the cache, then restarting the
 manager, and checking the cache.
Check an initialized cache by checking the cache then restarting the manager and checking the cache .
// If cache is disabled, then expect results immediately