From 8acf5b6cb8876bf1224124f9a88b73b280f029ff Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Fri, 16 Jul 2010 01:04:42 +0200 Subject: [PATCH] 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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/toolkit/components/places/src/nsPlacesExpiration.js b/toolkit/components/places/src/nsPlacesExpiration.js index 51d594a4d73c..239c9b0ce52b 100644 --- a/toolkit/components/places/src/nsPlacesExpiration.js +++ b/toolkit/components/places/src/nsPlacesExpiration.js @@ -684,11 +684,15 @@ nsPlacesExpiration.prototype = { _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; }