B2G/gecko/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
/**
 * Checks to see if a permission exists for the given URI.
 *
 * @param aURI
 *        The URI to check if a permission exists.
 * @param aExists
 *        True if the permission should exist, false otherwise.
 */
Checks to see if a permission exists for the given URI.
@param aURI
The URI to check if a permission exists.
@param aExists
True if the permission should exist, false otherwise.
Checks to see if a permission exists for the given URI . @param aURI The URI to check if a permission exists . @param aExists True if the permission should exist false otherwise .
function check_permission_exists(aURI, aExists)
{
  let pm = Cc["@mozilla.org/permissionmanager;1"].
           getService(Ci.nsIPermissionManager);
  let principal = Cc["@mozilla.org/scriptsecuritymanager;1"]
                    .getService(Ci.nsIScriptSecurityManager)
                    .getNoAppCodebasePrincipal(aURI);
  let perm = pm.testExactPermissionFromPrincipal(principal, PERMISSION_TYPE);
  let checker = aExists ? do_check_eq : do_check_neq;
  checker(perm, PERMISSION_VALUE);
}
function check_permission_exists ( aURI , aExists ) { let pm = Cc [ "@mozilla.org/permissionmanager;1" ] . getService ( Ci . nsIPermissionManager ) ; let principal = Cc [ "@mozilla.org/scriptsecuritymanager;1" ] . getService ( Ci . nsIScriptSecurityManager ) . getNoAppCodebasePrincipal ( aURI ) ; let perm = pm . testExactPermissionFromPrincipal ( principal , PERMISSION_TYPE ) ; let checker = aExists ? do_check_eq : do_check_neq ; checker ( perm , PERMISSION_VALUE ) ; }
Checks to see if a permission exists for the given URI.
Checks to see if a permission exists for the given URI .