B2G/gecko/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
/**
 * Checks to ensure that a cookie exists or not for a domain.
 *
 * @param aDomain
 *        The domain to check for the cookie.
 * @param aExists
 *        True if the cookie should exist, false otherwise.
 */
Checks to ensure that a cookie exists or not for a domain.
@param aDomain
The domain to check for the cookie.
@param aExists
True if the cookie should exist, false otherwise.
Checks to ensure that a cookie exists or not for a domain . @param aDomain The domain to check for the cookie . @param aExists True if the cookie should exist false otherwise .
function check_cookie_exists(aDomain, aExists)
{
  let cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
  let cookie = {
    host: aDomain,
    name: COOKIE_NAME,
    path: COOKIE_PATH
  }
  let checker = aExists ? do_check_true : do_check_false;
  checker(cm.cookieExists(cookie));
}
function check_cookie_exists ( aDomain , aExists ) { let cm = Cc [ "@mozilla.org/cookiemanager;1" ] . getService ( Ci . nsICookieManager2 ) ; let cookie = { host : aDomain , name : COOKIE_NAME , path : COOKIE_PATH } let checker = aExists ? do_check_true : do_check_false ; checker ( cm . cookieExists ( cookie ) ) ; }
Checks to ensure that a cookie exists or not for a domain.
Checks to ensure that a cookie exists or not for a domain .