test failure fix.
authorDan Witte <dwitte@mozilla.com>
Fri, 16 Oct 2009 16:16:31 -0700
changeset 33968 a891932b2dd866412e481c035247e619fcc74a6d
parent 33966 c26d01afbe6a4769f244d4d8f2dc5ff2e91b4b4b
child 33969 d8a5801e773ec5631a152b2c5e157d38cbd34a52
push idunknown
push userunknown
push dateunknown
milestone1.9.3a1pre
test failure fix.
extensions/cookie/nsPermissionManager.cpp
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -322,17 +322,17 @@ nsPermissionManager::Add(nsIURI     *aUR
                  aExpireType == nsIPermissionManager::EXPIRE_TIME ||
                  aExpireType == nsIPermissionManager::EXPIRE_SESSION,
                  NS_ERROR_INVALID_ARG);
 
   nsresult rv;
 
   // Skip addition if the permission is already expired.
   if (aExpireType == nsIPermissionManager::EXPIRE_TIME &&
-      aExpireTime < PR_Now() / 1000)
+      aExpireTime <= PR_Now() / 1000)
     return NS_OK;
 
   nsCAutoString host;
   rv = GetHost(aURI, host);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return AddInternal(host, nsDependentCString(aType), aPermission, 0, 
                      aExpireType, aExpireTime, eNotify, eWriteToDB);
@@ -588,17 +588,17 @@ nsPermissionManager::GetHostEntry(const 
 
   do {
     entry = mHostTable.GetEntry(aHost.get() + offset);
     if (entry) {
       nsPermissionEntry permEntry = entry->GetPermission(aType);
 
       // if the entry is expired, remove and keep looking for others.
       if (permEntry.mExpireType == nsIPermissionManager::EXPIRE_TIME &&
-          permEntry.mExpireTime < now)
+          permEntry.mExpireTime <= now)
         Remove(aHost, mTypeArray[aType].get());
       else if (permEntry.mPermission != nsIPermissionManager::UNKNOWN_ACTION)
         break;
 
       // reset entry, to be able to return null on failure
       entry = nsnull;
     }
     if (aExactHostMatch)
@@ -753,17 +753,17 @@ nsPermissionManager::Read()
 {
   nsresult rv;
 
   // delete expired permissions before we read in the db
   {
     // this deletion has its own scope so the write lock is released when done.
     nsCOMPtr<mozIStorageStatement> stmtDeleteExpired;
     rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING(
-          "DELETE FROM moz_hosts WHERE expireType = ?1 AND expireTime < ?2"),
+          "DELETE FROM moz_hosts WHERE expireType = ?1 AND expireTime <= ?2"),
           getter_AddRefs(stmtDeleteExpired));
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = stmtDeleteExpired->BindInt32Parameter(0, nsIPermissionManager::EXPIRE_TIME);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = stmtDeleteExpired->BindInt64Parameter(1, PR_Now() / 1000);
     NS_ENSURE_SUCCESS(rv, rv);