Bug 1808729 - Limit session store writes to once per hour when the user is idle, r=dao.

Differential Revision: https://phabricator.services.mozilla.com/D166099
This commit is contained in:
Florian Quèze
2023-01-16 14:55:22 +00:00
parent f050b3f7b6
commit a73b864d0a
3 changed files with 5 additions and 5 deletions

View File

@@ -51,7 +51,7 @@ add_task(async function testIntervalChanges() {
// Increase `idleDelay` to 1 day to update the pre-registered idle observer
// in "real" idle service to avoid possible interference, especially for the
// CI server environment.
Services.prefs.setIntPref("browser.sessionstore.idleDelay", 86400000);
Services.prefs.setIntPref("browser.sessionstore.idleDelay", 86400);
// Mock an idle service.
let fakeIdleService = MockRegistrar.register(
@@ -67,7 +67,7 @@ add_task(async function testIntervalChanges() {
// Hook idle/active observer to mock idle service by changing pref `idleDelay`
// to a whatever value, which will not be used.
Services.prefs.setIntPref("browser.sessionstore.idleDelay", 5000000);
Services.prefs.setIntPref("browser.sessionstore.idleDelay", 5000);
// Wait a `sessionstore-state-write-complete` event from any previous
// scheduled state write. This is needed since the `_lastSaveTime` in