B2G/gecko/toolkit/mozapps/extensions/test/browser/head.js
/**
   * Creates a set of mock add-on objects and adds them to the list of add-ons
   * managed by this provider.
   *
   * @param  aAddonProperties
   *         An array of objects containing properties describing the add-ons
   * @return Array of the new MockAddons
   */
Creates a set of mock add-on objects and adds them to the list of add-ons
managed by this provider.

@param  aAddonProperties
An array of objects containing properties describing the add-ons
@return Array of the new MockAddons
Creates a set of mock add - on objects and adds them to the list of add - ons managed by this provider . @param aAddonProperties An array of objects containing properties describing the add - ons @return Array of the new MockAddons
function MP_createAddons(aAddonProperties) {
    var newAddons = [];
    for (let addonProp of aAddonProperties) {
      let addon = new MockAddon(addonProp.id);
      for (let prop in addonProp) {
        if (prop == "id")
          continue;
        if (prop == "applyBackgroundUpdates") {
          addon._applyBackgroundUpdates = addonProp[prop];
          continue;
        }
        if (prop == "appDisabled") {
          addon._appDisabled = addonProp[prop];
          continue;
        }
        addon[prop] = addonProp[prop];
      }
      if (!addon.optionsType && !!addon.optionsURL)
        addon.optionsType = AddonManager.OPTIONS_TYPE_DIALOG;
      addon.isActive = addon.shouldBeActive;
      this.addAddon(addon);
      newAddons.push(addon);
    }
    return newAddons;
  }
function MP_createAddons ( aAddonProperties ) { var newAddons = [ ] ; for ( let addonProp of aAddonProperties ) { let addon = new MockAddon ( addonProp . id ) ; for ( let prop in addonProp ) { if ( prop == "id" ) continue ; if ( prop == "applyBackgroundUpdates" ) { addon . _applyBackgroundUpdates = addonProp [ prop ] ; continue ; } if ( prop == "appDisabled" ) { addon . _appDisabled = addonProp [ prop ] ; continue ; } addon [ prop ] = addonProp [ prop ] ; } if ( ! addon . optionsType && ! ! addon . optionsURL ) addon . optionsType = AddonManager . OPTIONS_TYPE_DIALOG ; addon . isActive = addon . shouldBeActive ; this . addAddon ( addon ) ; newAddons . push ( addon ) ; } return newAddons ; }
Creates a set of mock add-on objects and adds them to the list of add-ons
 managed by this provider.
Creates a set of mock add - on objects and adds them to the list of add - ons managed by this provider .
// Make sure the active state matches the passed in properties