follow-up to
Bug 578557 - disable idle expiration in manually controlled expiration tests. r=dietrich. orange fix on CLOSED TREE a=developers-channel
--- 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() {