follow-up to Bug 578557 - disable idle expiration in manually controlled expiration tests. r=dietrich. orange fix on CLOSED TREE a=developers-channel
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 16 Jul 2010 01:04:42 +0200
changeset 47779 2bfc4dd5487226fa9f5110532636748ff0ca0991
parent 47778 87e4561c270b04847dd651578eedb0ecfcd9c6f6
child 47780 e125e2e5a2dd542dd9c3f086cd5e64c62342eaf9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdietrich, developers-channel
bugs578557
milestone2.0b2pre
follow-up to Bug 578557 - disable idle expiration in manually controlled expiration tests. r=dietrich. orange fix on CLOSED TREE a=developers-channel
toolkit/components/places/src/nsPlacesExpiration.js
--- a/toolkit/components/places/src/nsPlacesExpiration.js
+++ b/toolkit/components/places/src/nsPlacesExpiration.js
@@ -679,21 +679,25 @@ nsPlacesExpiration.prototype = {
     }
     return aNewStatus;
   },
   get status() this._status,
 
   _isIdleObserver: false,
   set expireOnIdle(aObserveIdle) {
     if (aObserveIdle != this._isIdleObserver) {
-      if (aObserveIdle && !this._shuttingDown) {
+      // If running a debug expiration we need full control of what happens
+      // but idle cleanup could activate in the middle, since tinderboxes are
+      // permanently idle.  That would cause unexpected oranges, so disable it.
+      if (aObserveIdle && !this._shuttingDown &&
+          this._debugLimit === undefined) {
         this._idle.addIdleObserver(this, IDLE_TIMEOUT_SECONDS);
         this._isIdleObserver = true;
       }
-      else {
+      else if (this._isIdleObserver) {
         this._idle.removeIdleObserver(this, IDLE_TIMEOUT_SECONDS);
         this._isIdleObserver = false;
       }
     }
     return aObserveIdle;
   },
 
   _loadPrefs: function PEX__loadPrefs() {