B2G/gecko/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
/**
 * Adds a permission for the specified URI to the permission manager.
 *
 * @param aURI
 *        The URI to add the test permission for.
 */
Adds a permission for the specified URI to the permission manager.
@param aURI
The URI to add the test permission for.
Adds a permission for the specified URI to the permission manager . @param aURI The URI to add the test permission for .
function add_permission(aURI)
{
  check_permission_exists(aURI, false);
  let pm = Cc["@mozilla.org/permissionmanager;1"].
           getService(Ci.nsIPermissionManager);
  let principal = Cc["@mozilla.org/scriptsecuritymanager;1"]
                    .getService(Ci.nsIScriptSecurityManager)
                    .getNoAppCodebasePrincipal(aURI);
  pm.addFromPrincipal(principal, PERMISSION_TYPE, PERMISSION_VALUE);
  check_permission_exists(aURI, true);
}
function add_permission ( aURI ) { check_permission_exists ( aURI , false ) ; let pm = Cc [ "@mozilla.org/permissionmanager;1" ] . getService ( Ci . nsIPermissionManager ) ; let principal = Cc [ "@mozilla.org/scriptsecuritymanager;1" ] . getService ( Ci . nsIScriptSecurityManager ) . getNoAppCodebasePrincipal ( aURI ) ; pm . addFromPrincipal ( principal , PERMISSION_TYPE , PERMISSION_VALUE ) ; check_permission_exists ( aURI , true ) ; }
Adds a permission for the specified URI to the permission manager.
Adds a permission for the specified URI to the permission manager .