Closed Bug 540356 Opened 15 years ago Closed 14 years ago

Enforce a sane minimum interval for app.update.timer

Categories

(Toolkit :: Application Update, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: robert.strong.bugs, Assigned: robert.strong.bugs)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch rev1 (obsolete) — Splinter Review
I think 60 seconds should be adequate. The patch also allows xpcshell tests to set a value of 500 ms.
Attachment #422140 - Flags: review?(dtownsend)
Comment on attachment 422140 [details] [diff] [review]
patch rev1

I think I'd prefer to go with test-init instead of xpcshell-test-init. Besides that this should be good to go.
Attachment #422140 - Flags: review?(dtownsend) → review?(dolske)
Comment on attachment 422140 [details] [diff] [review]
patch rev1

>+    case "xpcshell-test-init":
>+      // For xpcshell tests require a minimum timer interval of 500 ms.
>+      minInterval = 500;
>     case "profile-after-change":

Add a /* fallthru */ comment here so it's clear that you didn't want a |break| here.

>-      this._start();
>+      this._timerInterval = Math.max(getPref("getIntPref", PREF_APP_UPDATE_TIMER, 600000),
>+                                     minInterval);
>+      this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
>+      this._timer.initWithCallback(this, this._timerInterval,
>+                                   Ci.nsITimer.TYPE_REPEATING_SLACK);

I think you'll end up with 2 timers here after xpcshell-test-init fires. Will any tests get confused if the old timer happens to fire while the test is running?

>-  gUTM.observe(null, "profile-after-change", "");
>+  gUTM.observe(null, "xpcshell-test-init", "");

I'd rename that to something less generic, lest that actually become a real notification xpcshells tests fire. :)

r+ with this stuff addressed.
Attachment #422140 - Flags: review?(dolske) → review+
(In reply to comment #2)
>...
> Add a /* fallthru */ comment here so it's clear that you didn't want a |break|
> here.
Done

> I think you'll end up with 2 timers here after xpcshell-test-init fires. Will
> any tests get confused if the old timer happens to fire while the test is
> running?
xpcshell tests don't fire profile-after-change but I might be needing this with mochi tests which do so I'll cancel / reinit the timer.

> >-  gUTM.observe(null, "profile-after-change", "");
> >+  gUTM.observe(null, "xpcshell-test-init", "");
> 
> I'd rename that to something less generic, lest that actually become a real
> notification xpcshells tests fire. :)
Done

I'll attach the updated patch before checkin and thanks for the review!
Carrying forward r+
Attachment #422140 - Attachment is obsolete: true
Attachment #424387 - Flags: review+
Pushed to mozilla-central
http://hg.mozilla.org/mozilla-central/rev/8d97e5540546
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Attachment #424387 - Flags: approval1.9.2.2?
Comment on attachment 424387 [details] [diff] [review]
patch for checkin

Moving out to 1.9.2.3. This is mostly a housekeeping fix, aiui, saves us from getting into a bad QA situation while verifying update behaviour. I'm okay to take it, but it's not something we'd hold this release for.
Attachment #424387 - Flags: approval1.9.2.2? → approval1.9.2.3?
Attachment #424387 - Flags: approval1.9.2.4?
Comment on attachment 424387 [details] [diff] [review]
patch for checkin

Let's hold off on this until after Lorentz and land it with bug 530872 and bug 538331 if they get approved
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: