tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit bc0c631e2e027444a8c154eec417ce8eaf7a9ac5
parent 2f7823af5dc778f61a9457de9bc42f615bf32c8b
Author: Cristina Horotan <chorotan@mozilla.com>
Date:   Tue, 18 Nov 2025 07:15:15 +0200

Revert "Bug 1999786, Bug 1996070 - Save a persistent state between screens for the backup spotlight. r=cdupuis,omc-reviewers,emcminn,sthompson" for causing bc failures on browser_settings.js

This reverts commit e567fc04567b9f5115f0fb7f75d4bf34a3d1ceac.

Revert "Bug 1999836 - Trigger handleAction to move to the new password spotlight screen when backing up all data. r=omc-reviewers,sthompson,emcminn,cdupuis"

This reverts commit a69b0adb399ce162b471b284e3010758f3d146b6.

Revert "Bug 1996070 - (part 2) Update tests to reflect BackupServiceState changes. r=cdupuis"

This reverts commit 686ce3b4a3d0cdcdda26395df2cfb41628f9e493.

Revert "Bug 1996070 - (part 1) Move backup enable status states and error codes to the BackupService internal state and remove privileged instances from the backup UI. r=cdupuis"

This reverts commit ef6d47f01dadd7a13f3e6add1eecb9c271289df3.

Diffstat:
Mbrowser/components/DesktopActorRegistry.sys.mjs | 5-----
Mbrowser/components/aboutwelcome/content-src/components/EmbeddedFxBackupOptIn.jsx | 26++++----------------------
Mbrowser/components/aboutwelcome/content/aboutwelcome.bundle.js | 20+++-----------------
Mbrowser/components/aboutwelcome/karma.mc.config.js | 2+-
Mbrowser/components/backup/BackupService.sys.mjs | 56+-------------------------------------------------------
Mbrowser/components/backup/actors/BackupUIChild.sys.mjs | 6------
Mbrowser/components/backup/actors/BackupUIParent.sys.mjs | 13-------------
Mbrowser/components/backup/content/backup-settings.mjs | 60+++++++++++++++++++++++++++++++++++++++++++++---------------
Mbrowser/components/backup/content/backup-settings.stories.mjs | 12------------
Mbrowser/components/backup/content/turn-on-scheduled-backups.mjs | 65+++--------------------------------------------------------------
Mbrowser/components/backup/tests/browser/browser_password_validation_inputs.js | 11+++++------
Mbrowser/components/backup/tests/browser/browser_settings.js | 55++++++++++++++++++-------------------------------------
Mbrowser/components/backup/tests/browser/browser_settings_turn_off_scheduled_backups.js | 20++++++++++----------
Mbrowser/components/backup/tests/browser/browser_settings_turn_on_scheduled_backups.js | 192+++++--------------------------------------------------------------------------
Mbrowser/components/backup/tests/chrome/chrome.toml | 1-
Mbrowser/components/backup/tests/chrome/head.js | 20--------------------
Mbrowser/components/backup/tests/chrome/test_backup_settings.html | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------
Mbrowser/components/backup/tests/chrome/test_trigger_create_backup.html | 25++++++++++++++++++-------
Mbrowser/components/backup/tests/xpcshell/test_BackupService_retryHeuristic.js | 24+++++++++++-------------
Mbrowser/components/backup/tests/xpcshell/test_BackupService_wrongPassword.js | 3+--
Mbrowser/components/storybook/component-status/components.json | 2+-
21 files changed, 207 insertions(+), 509 deletions(-)

diff --git a/browser/components/DesktopActorRegistry.sys.mjs b/browser/components/DesktopActorRegistry.sys.mjs @@ -238,11 +238,6 @@ let JSWINDOWACTORS = { "BackupUI:RerunEncryption": { wantUntrusted: true }, "BackupUI:ShowBackupLocation": { wantUntrusted: true }, "BackupUI:EditBackupLocation": { wantUntrusted: true }, - "BackupUI:ErrorBarDismissed": { wantUntrusted: true }, - "BackupUI:SetEmbeddedComponentPersistentData": { wantUntrusted: true }, - "BackupUI:FlushEmbeddedComponentPersistentData": { - wantUntrusted: true, - }, }, }, includeChrome: true, diff --git a/browser/components/aboutwelcome/content-src/components/EmbeddedFxBackupOptIn.jsx b/browser/components/aboutwelcome/content-src/components/EmbeddedFxBackupOptIn.jsx @@ -23,22 +23,14 @@ export const EmbeddedFxBackupOptIn = ({ useEffect(() => { const { current } = backupRef; - const handleEnableScheduledBackups = () => { - handleAction({ - currentTarget: { value: "tile_button" }, - action: { navigate: true }, - source: "backup_enabled", - }); - }; - const handleAdvanceScreens = () => { + const handleBackupEvent = () => { handleAction({ currentTarget: { value: "tile_button" }, action: { navigate: true }, - source: "advance_screens", + source: "backup_enabled", }); }; - const handleStateUpdate = ({ detail: { state } }) => { if (!current || !state) { return; @@ -53,26 +45,17 @@ export const EmbeddedFxBackupOptIn = ({ current?.addEventListener("BackupUI:StateWasUpdated", handleStateUpdate); current?.addEventListener( "BackupUI:EnableScheduledBackups", - handleEnableScheduledBackups - ); - current?.addEventListener( - "SpotlightOnboardingAdvanceScreens", - handleAdvanceScreens + handleBackupEvent ); - return () => { current?.removeEventListener( "BackupUI:EnableScheduledBackups", - handleEnableScheduledBackups + handleBackupEvent ); current?.removeEventListener( "BackupUI:StateWasUpdated", handleStateUpdate ); - current?.removeEventListener( - "SpotlightOnboardingAdvanceScreens", - handleAdvanceScreens - ); }; }, []); // eslint-disable-line react-hooks/exhaustive-deps @@ -90,7 +73,6 @@ export const EmbeddedFxBackupOptIn = ({ isEncryptedBackup && !hide_password_input ? "" : undefined } embedded-fx-backup-opt-in={""} - backup-is-encrypted={isEncryptedBackup ? "" : undefined} file-path-label-l10n-id={file_path_label} turn-on-backup-header-l10n-id={turn_on_backup_header} create-password-label-l10n-id={create_password_label} diff --git a/browser/components/aboutwelcome/content/aboutwelcome.bundle.js b/browser/components/aboutwelcome/content/aboutwelcome.bundle.js @@ -3432,7 +3432,7 @@ const EmbeddedFxBackupOptIn = ({ const { current } = backupRef; - const handleEnableScheduledBackups = () => { + const handleBackupEvent = () => { handleAction({ currentTarget: { value: "tile_button" @@ -3443,17 +3443,6 @@ const EmbeddedFxBackupOptIn = ({ source: "backup_enabled" }); }; - const handleAdvanceScreens = () => { - handleAction({ - currentTarget: { - value: "tile_button" - }, - action: { - navigate: true - }, - source: "advance_screens" - }); - }; const handleStateUpdate = ({ detail: { state @@ -3473,12 +3462,10 @@ const EmbeddedFxBackupOptIn = ({ current.supportBaseLink = state.supportBaseLink; }; current?.addEventListener("BackupUI:StateWasUpdated", handleStateUpdate); - current?.addEventListener("BackupUI:EnableScheduledBackups", handleEnableScheduledBackups); - current?.addEventListener("SpotlightOnboardingAdvanceScreens", handleAdvanceScreens); + current?.addEventListener("BackupUI:EnableScheduledBackups", handleBackupEvent); return () => { - current?.removeEventListener("BackupUI:EnableScheduledBackups", handleEnableScheduledBackups); + current?.removeEventListener("BackupUI:EnableScheduledBackups", handleBackupEvent); current?.removeEventListener("BackupUI:StateWasUpdated", handleStateUpdate); - current?.removeEventListener("SpotlightOnboardingAdvanceScreens", handleAdvanceScreens); }; }, []); // eslint-disable-line react-hooks/exhaustive-deps @@ -3489,7 +3476,6 @@ const EmbeddedFxBackupOptIn = ({ "hide-secondary-button": !isEncryptedBackup || hide_secondary_button ? "" : undefined, "hide-file-path-chooser": isEncryptedBackup && !hide_password_input ? "" : undefined, "embedded-fx-backup-opt-in": "", - "backup-is-encrypted": isEncryptedBackup ? "" : undefined, "file-path-label-l10n-id": file_path_label, "turn-on-backup-header-l10n-id": turn_on_backup_header, "create-password-label-l10n-id": create_password_label, diff --git a/browser/components/aboutwelcome/karma.mc.config.js b/browser/components/aboutwelcome/karma.mc.config.js @@ -132,7 +132,7 @@ module.exports = function (config) { "content-src/components/EmbeddedFxBackupOptIn.jsx": { statements: 60, lines: 60, - functions: 50, + functions: 60, branches: 60, }, "content-src/components/MSLocalized.jsx": { diff --git a/browser/components/backup/BackupService.sys.mjs b/browser/components/backup/BackupService.sys.mjs @@ -189,19 +189,6 @@ XPCOMUtils.defineLazyPreferenceGetter( 5 ); -XPCOMUtils.defineLazyPreferenceGetter( - lazy, - "backupErrorCode", - BACKUP_ERROR_CODE_PREF_NAME, - 0, - function onUpdateBackupErrorCode(_pref, _prevVal, newVal) { - let bs = BackupService.get(); - if (bs) { - bs.onUpdateBackupErrorCode(newVal); - } - } -); - XPCOMUtils.defineLazyServiceGetter( lazy, "idleService", @@ -775,19 +762,6 @@ export class BackupService extends EventTarget { } /** - * Sets the persisted options between screens for embedded components. - * This is specifically used in the Spotlight onboarding experience. - * - * This data is flushed upon creating a backup or exiting the backup flow. - * - * @param {object} data - data to persist between screens. - */ - setEmbeddedComponentPersistentData(data) { - this.#_state.embeddedComponentPersistentData = { ...data }; - this.stateUpdate(); - } - - /** * An object holding the current state of the BackupService instance, for * the purposes of representing it in the user interface. Ideally, this would * be named #state instead of #_state, but sphinx-js seems to be fairly @@ -808,6 +782,7 @@ export class BackupService extends EventTarget { lastBackupFileName: "", supportBaseLink: Services.urlFormatter.formatURLPref("app.support.baseURL"), recoveryInProgress: false, + recoveryErrorCode: 0, /** * Every file we load successfully is going to get a restore ID which is * basically the identifier for that profile restore event. If we actually @@ -816,12 +791,6 @@ export class BackupService extends EventTarget { * restored. */ restoreID: null, - recoveryErrorCode: ERRORS.NONE, - backupErrorCode: lazy.backupErrorCode, - archiveEnabledStatus: this.archiveEnabledStatus.enabled, - restoreEnabledStatus: this.restoreEnabledStatus.enabled, - /** Utilized by the spotlight to persist information between screens */ - embeddedComponentPersistentData: {}, }; /** @@ -1727,7 +1696,6 @@ export class BackupService extends EventTarget { }) ); - this.stateUpdate(); throw e; } finally { this.#backupInProgress = false; @@ -3557,20 +3525,6 @@ export class BackupService extends EventTarget { } /** - * Updates backupErrorCode in the backup service state. Should be called every time - * the value for browser.backup.errorCode changes. - * - * @param {number} newErrorCode - * Any of the ERROR code's from backup-constants.mjs - */ - onUpdateBackupErrorCode(newErrorCode) { - lazy.logConsole.debug(`Updating backup error code to ${newErrorCode}`); - - this.#_state.backupErrorCode = newErrorCode; - this.stateUpdate(); - } - - /** * Returns the moz-icon URL of a file. To get the moz-icon URL, the * file path is convered to a fileURI. If there is a problem retreiving * the moz-icon due to an invalid file path, return null instead. @@ -3606,9 +3560,6 @@ export class BackupService extends EventTarget { if (shouldEnableScheduledBackups) { // reset the error states when reenabling backup Services.prefs.setIntPref(BACKUP_ERROR_CODE_PREF_NAME, ERRORS.NONE); - - // flush the embedded component's persistent data - this.setEmbeddedComponentPersistentData({}); } else { // set user-disabled pref if backup is being disabled Services.prefs.setBoolPref( @@ -4139,11 +4090,6 @@ export class BackupService extends EventTarget { * 2. If archive is disabled, clean up any backup files */ #handleStatusChange() { - // Update the BackupService state before notifying observers about the - // state change - this.#_state.archiveEnabledStatus = this.archiveEnabledStatus.enabled; - this.#_state.restoreEnabledStatus = this.restoreEnabledStatus.enabled; - this.#notifyStatusObservers(); if (!this.archiveEnabledStatus.enabled) { diff --git a/browser/components/backup/actors/BackupUIChild.sys.mjs b/browser/components/backup/actors/BackupUIChild.sys.mjs @@ -138,12 +138,6 @@ export class BackupUIChild extends JSWindowActorChild { this.sendAsyncMessage("ShowBackupLocation"); } else if (event.type == "BackupUI:EditBackupLocation") { this.sendAsyncMessage("EditBackupLocation"); - } else if (event.type == "BackupUI:ErrorBarDismissed") { - this.sendAsyncMessage("ErrorBarDismissed"); - } else if (event.type == "BackupUI:SetEmbeddedComponentPersistentData") { - this.sendAsyncMessage("SetEmbeddedComponentPersistentData", event.detail); - } else if (event.type == "BackupUI:FlushEmbeddedComponentPersistentData") { - this.sendAsyncMessage("FlushEmbeddedComponentPersistentData"); } } diff --git a/browser/components/backup/actors/BackupUIParent.sys.mjs b/browser/components/backup/actors/BackupUIParent.sys.mjs @@ -18,8 +18,6 @@ ChromeUtils.defineLazyGetter(lazy, "logConsole", function () { }); }); -const BACKUP_ERROR_CODE_PREF_NAME = "browser.backup.errorCode"; - /** * A JSWindowActor that is responsible for marshalling information between * the BackupService singleton and any registered UI widgets that need to @@ -51,7 +49,6 @@ export class BackupUIParent extends JSWindowActorParent { */ actorCreated() { this.#bs.addEventListener("BackupService:StateUpdate", this); - Services.obs.addObserver(this.sendState, "backup-service-status-updated"); // Note that loadEncryptionState is an async function. // This function is no-op if the encryption state was already loaded. this.#bs.loadEncryptionState(); @@ -62,10 +59,6 @@ export class BackupUIParent extends JSWindowActorParent { */ didDestroy() { this.#bs.removeEventListener("BackupService:StateUpdate", this); - Services.obs.removeObserver( - this.sendState, - "backup-service-status-updated" - ); } /** @@ -270,12 +263,6 @@ export class BackupUIParent extends JSWindowActorParent { e ); } - } else if (message.name == "ErrorBarDismissed") { - Services.prefs.setIntPref(BACKUP_ERROR_CODE_PREF_NAME, lazy.ERRORS.NONE); - } else if (message.name == "SetEmbeddedComponentPersistentData") { - this.#bs.setEmbeddedComponentPersistentData(message.data); - } else if (message.name == "FlushEmbeddedComponentPersistentData") { - this.#bs.setEmbeddedComponentPersistentData({}); } return null; diff --git a/browser/components/backup/content/backup-settings.mjs b/browser/components/backup/content/backup-settings.mjs @@ -7,6 +7,12 @@ import { MozLitElement } from "chrome://global/content/lit-utils.mjs"; import { getErrorL10nId } from "chrome://browser/content/backup/backup-errors.mjs"; import { ERRORS } from "chrome://browser/content/backup/backup-constants.mjs"; +const lazy = {}; + +ChromeUtils.defineESModuleGetters(lazy, { + BackupService: "resource:///modules/backup/BackupService.sys.mjs", +}); + // eslint-disable-next-line import/no-unassigned-import import "chrome://browser/content/backup/turn-on-scheduled-backups.mjs"; // eslint-disable-next-line import/no-unassigned-import @@ -18,12 +24,15 @@ import "chrome://browser/content/backup/enable-backup-encryption.mjs"; // eslint-disable-next-line import/no-unassigned-import import "chrome://browser/content/backup/disable-backup-encryption.mjs"; +const BACKUP_ERROR_CODE_PREF_NAME = "browser.backup.errorCode"; + /** * The widget for managing the BackupService that is embedded within the main * document of about:settings / about:preferences. */ export default class BackupSettings extends MozLitElement { #placeholderIconURL = "chrome://global/skin/icons/page-portrait.svg"; + #backupService = lazy.BackupService.init(); inProgressTimeout = null; showInProgress = false; @@ -32,7 +41,10 @@ export default class BackupSettings extends MozLitElement { static properties = { backupServiceState: { type: Object }, + backupErrorCode: { type: Number }, _enableEncryptionTypeAttr: { type: String }, + _archiveEnabled: { type: Boolean }, + _restoreEnabled: { type: Boolean }, }; static get queries() { @@ -99,14 +111,18 @@ export default class BackupSettings extends MozLitElement { supportBaseLink: "", backupInProgress: false, recoveryInProgress: false, - recoveryErrorCode: ERRORS.NONE, - backupErrorCode: ERRORS.NONE, - archiveEnabledStatus: false, - restoreEnabledStatus: false, + recoveryErrorCode: 0, }; + this.backupErrorCode = this.#readBackupErrorPref(); this._enableEncryptionTypeAttr = ""; + this.updateArchiveAndRestoreState(); } + updateArchiveAndRestoreState = () => { + this._archiveEnabled = this.#backupService.archiveEnabledStatus.enabled; + this._restoreEnabled = this.#backupService.restoreEnabledStatus.enabled; + }; + /** * Dispatches the BackupUI:InitWidget custom event upon being attached to the * DOM, which registers with BackupUIChild for BackupService state updates. @@ -117,16 +133,34 @@ export default class BackupSettings extends MozLitElement { new CustomEvent("BackupUI:InitWidget", { bubbles: true }) ); + Services.obs.addObserver( + this.updateArchiveAndRestoreState, + "backup-service-status-updated" + ); + + this._cleanupObs = () => { + Services.obs.removeObserver( + this.updateArchiveAndRestoreState, + "backup-service-status-updated" + ); + window.removeEventListener("unload", this._cleanupObs); + }; + + window.addEventListener("unload", this._cleanupObs, { once: true }); + this.addEventListener("dialogCancel", this); this.addEventListener("restoreFromBackupConfirm", this); this.addEventListener("restoreFromBackupChooseFile", this); } + #readBackupErrorPref() { + return Services.prefs.getIntPref(BACKUP_ERROR_CODE_PREF_NAME); + } + handleErrorBarDismiss = () => { // Reset the pref and reactive state; Lit will re-render without the bar. - this.dispatchEvent( - new CustomEvent("BackupUI:ErrorBarDismissed", { bubbles: true }) - ); + Services.prefs.setIntPref(BACKUP_ERROR_CODE_PREF_NAME, ERRORS.NONE); + this.backupErrorCode = 0; }; handleEvent(event) { @@ -442,7 +476,7 @@ export default class BackupSettings extends MozLitElement { } errorBarTemplate() { - const l10nId = getErrorL10nId(this.backupServiceState.backupErrorCode); + const l10nId = getErrorL10nId(this.backupErrorCode); return html` <moz-message-bar type="error" @@ -502,15 +536,13 @@ export default class BackupSettings extends MozLitElement { rel="stylesheet" href="chrome://browser/content/backup/backup-settings.css" /> - ${this.backupServiceState.backupErrorCode - ? this.errorBarTemplate() - : null} + ${this.backupErrorCode ? this.errorBarTemplate() : null} ${this.showInProgress ? this.inProgressMessageBarTemplate() : null} ${this.turnOnScheduledBackupsDialogTemplate()} ${this.turnOffScheduledBackupsDialogTemplate()} ${this.enableBackupEncryptionDialogTemplate()} ${this.disableBackupEncryptionDialogTemplate()} - ${this.backupServiceState.archiveEnabledStatus + ${this._archiveEnabled ? html` <section id="scheduled-backups"> <div class="backups-control"> <span @@ -552,9 +584,7 @@ export default class BackupSettings extends MozLitElement { : null} </section>` : null} - ${this.backupServiceState.restoreEnabledStatus - ? this.restoreFromBackupTemplate() - : null} `; + ${this._restoreEnabled ? this.restoreFromBackupTemplate() : null} `; } } diff --git a/browser/components/backup/content/backup-settings.stories.mjs b/browser/components/backup/content/backup-settings.stories.mjs @@ -28,9 +28,6 @@ ScheduledBackupsDisabled.args = { fileName: "Documents", }, scheduledBackupsEnabled: false, - backupErrorCode: 0, - archiveEnabledStatus: true, - restoreEnabledStatus: true, }, }; @@ -43,9 +40,6 @@ ScheduledBackupsEnabled.args = { fileName: "Documents", }, scheduledBackupsEnabled: true, - backupErrorCode: 0, - archiveEnabledStatus: true, - restoreEnabledStatus: true, }, }; @@ -60,9 +54,6 @@ ExistingBackup.args = { scheduledBackupsEnabled: true, lastBackupDate: 1719625747, lastBackupFileName: "FirefoxBackup_default_123123123.html", - backupErrorCode: 0, - archiveEnabledStatus: true, - restoreEnabledStatus: true, }, }; @@ -78,8 +69,5 @@ EncryptionEnabled.args = { encryptionEnabled: true, lastBackupDate: 1719625747, lastBackupFileName: "FirefoxBackup_default_123123123.html", - backupErrorCode: 0, - archiveEnabledStatus: true, - restoreEnabledStatus: true, }, }; diff --git a/browser/components/backup/content/turn-on-scheduled-backups.mjs b/browser/components/backup/content/turn-on-scheduled-backups.mjs @@ -57,11 +57,6 @@ export default class TurnOnScheduledBackups extends MozLitElement { reflect: true, attribute: "hide-secondary-button", }, - backupIsEncrypted: { - type: Boolean, - reflect: true, - attribute: "backup-is-encrypted", - }, filePathLabelL10nId: { type: String, reflect: true, @@ -151,20 +146,6 @@ export default class TurnOnScheduledBackups extends MozLitElement { this._newPath = path; this._newLabel = filename; this._newIconURL = iconURL; - - if (this.embeddedFxBackupOptIn) { - // Let's set a persistent path - this.dispatchEvent( - new CustomEvent("BackupUI:SetEmbeddedComponentPersistentData", { - bubbles: true, - detail: { - path, - label: filename, - iconURL, - }, - }) - ); - } } else if (event.type == "ValidPasswordsDetected") { let { password } = event.detail; this._passwordsMatch = true; @@ -213,24 +194,6 @@ export default class TurnOnScheduledBackups extends MozLitElement { detail.password = this._inputPassValue; } - if (this.embeddedFxBackupOptIn && this.backupIsEncrypted) { - if (!detail.password) { - // We're in the embedded component and we haven't set a password yet - // when one is expected, let's not do a confirm action yet! - this.dispatchEvent( - new CustomEvent("SpotlightOnboardingAdvanceScreens", { - bubbles: true, - }) - ); - return; - } - - // The persistent data will take precedence over the default path - detail.parentDirPath = - this.backupServiceState?.embeddedComponentPersistentData?.path || - detail.parentDirPath; - } - this.dispatchEvent( new CustomEvent("BackupUI:EnableScheduledBackups", { bubbles: true, @@ -277,17 +240,6 @@ export default class TurnOnScheduledBackups extends MozLitElement { const passwordElement = this.passwordOptionsExpandedEl; passwordElement.reset(); } - - if ( - this.embeddedFxBackupOptIn && - this.backupServiceState?.embeddedComponentPersistentData - ) { - this.dispatchEvent( - new CustomEvent("BackupUI:FlushEmbeddedComponentPersistentData", { - bubbles: true, - }) - ); - } } defaultFilePathInputTemplate() { @@ -315,19 +267,9 @@ export default class TurnOnScheduledBackups extends MozLitElement { `; } - /** - * Note: We also consider the embeddedComponentPersistentData since we might be in the - * Spotlight where we need this persistent data between screens. This state property should - * not be set if we are not in the Spotlight. - */ customFilePathInputTemplate() { - let filename = - this._newLabel || - this.backupServiceState?.embeddedComponentPersistentData?.label; - let iconURL = - this._newIconURL || - this.backupServiceState?.embeddedComponentPersistentData?.iconURL || - this.#placeholderIconURL; + let filename = this._newLabel; + let iconURL = this._newIconURL || this.#placeholderIconURL; return html` <input @@ -362,8 +304,7 @@ export default class TurnOnScheduledBackups extends MozLitElement { "turn-on-scheduled-backups-location-label"} ></label> <div id="backup-location-filepicker"> - ${!this._newPath && - !this.backupServiceState?.embeddedComponentPersistentData?.path + ${!this._newPath ? this.defaultFilePathInputTemplate() : this.customFilePathInputTemplate()} <moz-button diff --git a/browser/components/backup/tests/browser/browser_password_validation_inputs.js b/browser/components/backup/tests/browser/browser_password_validation_inputs.js @@ -10,14 +10,14 @@ const SCHEDULED_BACKUPS_ENABLED_PREF = "browser.backup.scheduled.enabled"; * as expected. */ add_task(async function password_validation() { - await SpecialPowers.pushPrefEnv({ - set: [[SCHEDULED_BACKUPS_ENABLED_PREF, true]], - }); - await BrowserTestUtils.withNewTab("about:preferences#sync", async browser => { let sandbox = sinon.createSandbox(); let settings = browser.contentDocument.querySelector("backup-settings"); + await SpecialPowers.pushPrefEnv({ + set: [[SCHEDULED_BACKUPS_ENABLED_PREF, true]], + }); + settings.backupServiceState.encryptionEnabled = true; await settings.requestUpdate(); await settings.updateComplete; @@ -141,8 +141,7 @@ add_task(async function password_validation() { ); Assert.ok(true, "Password rules tooltip should be hidden"); + await SpecialPowers.popPrefEnv(); sandbox.restore(); }); - - await SpecialPowers.popPrefEnv(); }); diff --git a/browser/components/backup/tests/browser/browser_settings.js b/browser/components/backup/tests/browser/browser_settings.js @@ -20,11 +20,11 @@ add_setup(async () => { /** * Tests that the section for controlling backup in about:preferences#sync is - * visible, but can also be hidden via a pref. We need to close and open the - * pages since we need a page refresh to see the pref change in effect. + * visible, but can also be hidden via a pref. */ add_task(async function test_preferences_visibility() { await BrowserTestUtils.withNewTab("about:preferences#sync", async browser => { + const sandbox = sinon.createSandbox(); let settings = browser.contentDocument.querySelector("backup-settings"); // Our mochitest-browser tests are configured to have the section visible @@ -34,61 +34,48 @@ add_task(async function test_preferences_visibility() { BrowserTestUtils.isVisible(settings.archiveSectionEl), "Backup section is visible" ); - }); - await SpecialPowers.pushPrefEnv({ - set: [["privacy.sanitize.sanitizeOnShutdown", true]], - }); - - await BrowserTestUtils.withNewTab("about:preferences#sync", async browser => { - let settings = browser.contentDocument.querySelector("backup-settings"); + await SpecialPowers.pushPrefEnv({ + set: [["privacy.sanitize.sanitizeOnShutdown", true]], + }); Assert.ok( !settings.restoreSectionEl && !settings.archiveSectionEl, "Backup section is not available when sanitizeOnShutdown is enabled" ); - }); - - await SpecialPowers.popPrefEnv(); - await BrowserTestUtils.withNewTab("about:preferences#sync", async browser => { - let settings = browser.contentDocument.querySelector("backup-settings"); + await SpecialPowers.popPrefEnv(); Assert.ok( BrowserTestUtils.isVisible(settings.restoreSectionEl) && BrowserTestUtils.isVisible(settings.archiveSectionEl), "Backup section is visible now" ); - }); - await SpecialPowers.pushPrefEnv({ - set: [[BACKUP_ARCHIVE_ENABLED_PREF, false]], - }); - - await BrowserTestUtils.withNewTab("about:preferences#sync", async browser => { - let settings = browser.contentDocument.querySelector("backup-settings"); + await SpecialPowers.pushPrefEnv({ + set: [[BACKUP_ARCHIVE_ENABLED_PREF, false]], + }); Assert.ok( BrowserTestUtils.isVisible(settings.restoreSectionEl) && !settings.archiveSectionEl, "Backup section is still visible since restore is enabled" ); - }); - - await SpecialPowers.pushPrefEnv({ - set: [[BACKUP_RESTORE_ENABLED_PREF, false]], - }); - await BrowserTestUtils.withNewTab("about:preferences#sync", async browser => { - let settings = browser.contentDocument.querySelector("backup-settings"); + await SpecialPowers.pushPrefEnv({ + set: [[BACKUP_RESTORE_ENABLED_PREF, false]], + }); Assert.ok( !settings.restoreSectionEl && !settings.archiveSectionEl, "Backup section is not available anymore after both archive and restore are disabled" ); + + await SpecialPowers.popPrefEnv(); + await SpecialPowers.popPrefEnv(); + + sandbox.restore(); }); - await SpecialPowers.popPrefEnv(); - await SpecialPowers.popPrefEnv(); }); /** @@ -426,13 +413,6 @@ add_task(async function test_last_backup_info_and_location() { let newBackupParent = await IOUtils.getDirectory( TEST_NEW_BACKUP_PARENT_PATH ); - registerCleanupFunction(async function () { - try { - await IOUtils.remove(TEST_NEW_BACKUP_PARENT_PATH, { recursive: true }); - } catch (e) { - Assert.ok(false, "Had some trouble cleaning up the backup directory"); - } - }); stateUpdated = BrowserTestUtils.waitForEvent( bs, @@ -455,6 +435,7 @@ add_task(async function test_last_backup_info_and_location() { await filePickerShownPromise; await stateUpdated; + await IOUtils.remove(TEST_NEW_BACKUP_PARENT_PATH); await SpecialPowers.popPrefEnv(); sandbox.restore(); }); diff --git a/browser/components/backup/tests/browser/browser_settings_turn_off_scheduled_backups.js b/browser/components/backup/tests/browser/browser_settings_turn_off_scheduled_backups.js @@ -50,16 +50,6 @@ async function turnOffScheduledBackupsHelper(browser, taskFn) { await taskFn(); } -add_setup(async () => { - await SpecialPowers.pushPrefEnv({ - set: [[SCHEDULED_BACKUPS_ENABLED_PREF, true]], - }); - - registerCleanupFunction(async () => { - await SpecialPowers.popPrefEnv(); - }); -}); - /** * Tests that the turn off scheduled backups dialog can set * browser.backup.scheduled.enabled to false from the settings page @@ -75,6 +65,10 @@ add_task(async function test_turn_off_scheduled_backups_confirm() { .stub(BackupService.prototype, "deleteLastBackup") .resolves(true); + await SpecialPowers.pushPrefEnv({ + set: [[SCHEDULED_BACKUPS_ENABLED_PREF, true]], + }); + await turnOffScheduledBackupsHelper(browser, () => { let scheduledPrefVal = Services.prefs.getBoolPref( SCHEDULED_BACKUPS_ENABLED_PREF @@ -99,6 +93,7 @@ add_task(async function test_turn_off_scheduled_backups_confirm() { let events = Glean.browserBackup.toggleOff.testGetValue(); Assert.equal(events.length, 1, "Found the toggleOff Glean event."); + await SpecialPowers.popPrefEnv(); sandbox.restore(); }); }); @@ -131,6 +126,10 @@ add_task(async function test_turn_off_scheduled_backups_disables_encryption() { }; }); + await SpecialPowers.pushPrefEnv({ + set: [[SCHEDULED_BACKUPS_ENABLED_PREF, true]], + }); + await turnOffScheduledBackupsHelper(browser, () => { Assert.ok( disableEncryptionStub.calledOnce, @@ -142,6 +141,7 @@ add_task(async function test_turn_off_scheduled_backups_disables_encryption() { ); }); + await SpecialPowers.popPrefEnv(); sandbox.restore(); }); }); diff --git a/browser/components/backup/tests/browser/browser_settings_turn_on_scheduled_backups.js b/browser/components/backup/tests/browser/browser_settings_turn_on_scheduled_backups.js @@ -9,22 +9,6 @@ const { ERRORS } = ChromeUtils.importESModule( const SCHEDULED_BACKUPS_ENABLED_PREF = "browser.backup.scheduled.enabled"; -async function setup_mockFilePicker(mockParentDir) { - const dummyFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile); - - dummyFile.initWithPath(mockParentDir); - let filePickerShownPromise = new Promise(resolve => { - MockFilePicker.showCallback = () => { - Assert.ok(true, "Filepicker shown"); - MockFilePicker.setFiles([dummyFile]); - resolve(); - }; - }); - MockFilePicker.returnValue = MockFilePicker.returnOK; - - return { filePickerShownPromise }; -} - add_setup(async () => { MockFilePicker.init(window.browsingContext); registerCleanupFunction(() => { @@ -112,9 +96,19 @@ add_task(async function test_turn_on_custom_location_filepicker() { PathUtils.tempDir, "settings-custom-dir-test" ); + const dummyFile = Cc["@mozilla.org/file/local;1"].createInstance( + Ci.nsIFile + ); - let { filePickerShownPromise } = - await setup_mockFilePicker(mockCustomParentDir); + dummyFile.initWithPath(mockCustomParentDir); + let filePickerShownPromise = new Promise(resolve => { + MockFilePicker.showCallback = () => { + Assert.ok(true, "Filepicker shown"); + MockFilePicker.setFiles([dummyFile]); + resolve(); + }; + }); + MockFilePicker.returnValue = MockFilePicker.returnOK; // After setting up mocks, start testing components /** @type {import("../../content/backup-settings.mjs").default} */ @@ -555,165 +549,3 @@ add_task(async function test_default_location_selected() { await SpecialPowers.popPrefEnv(); }); - -/** - * Tests that the persistent data for embedded components is set when a user picks a file - * and is flushed once backup is enabled. - */ -add_task(async function test_embedded_component_persistent_data_filepicker() { - await SpecialPowers.pushPrefEnv({ - set: [[SCHEDULED_BACKUPS_ENABLED_PREF, false]], - }); - - await BrowserTestUtils.withNewTab("about:preferences#sync", async browser => { - const mockCustomParentDir = await IOUtils.createUniqueDirectory( - PathUtils.tempDir, - "our-dummy-folder" - ); - let { filePickerShownPromise } = - await setup_mockFilePicker(mockCustomParentDir); - - let settings = browser.contentDocument.querySelector("backup-settings"); - let turnOnButton = settings.scheduledBackupsButtonEl; - - Assert.ok( - turnOnButton, - "Button to turn on scheduled backups should be found" - ); - - turnOnButton.click(); - - await settings.updateComplete; - let turnOnScheduledBackups = settings.turnOnScheduledBackupsEl; - - // for the purposes of this test, we will act like we are an embedded component - turnOnScheduledBackups.embeddedFxBackupOptIn = true; - - // First verify the default input value and dir path button - let filePathButton = turnOnScheduledBackups.filePathButtonEl; - let stateUpdatePromise = BrowserTestUtils.waitForEvent( - window, - "BackupUI:StateWasUpdated" - ); - Assert.ok( - filePathButton, - "Button for choosing a file path should be found" - ); - filePathButton.click(); - - await filePickerShownPromise; - await stateUpdatePromise; - await turnOnScheduledBackups.updateComplete; - - Assert.equal( - settings.backupServiceState.embeddedComponentPersistentData.path, - mockCustomParentDir, - "Our persistent path should be set correctly" - ); - - // Let's create a backup - let confirmButton = turnOnScheduledBackups.confirmButtonEl; - let promise = BrowserTestUtils.waitForEvent( - window, - "BackupUI:EnableScheduledBackups" - ); - - Assert.ok(confirmButton, "Confirm button should be found"); - - confirmButton.click(); - - await promise; - await settings.updateComplete; - }); - - await BrowserTestUtils.withNewTab("about:preferences#sync", async browser => { - let settings = browser.contentDocument.querySelector("backup-settings"); - await settings.updateComplete; - - Assert.deepEqual( - settings.backupServiceState.embeddedComponentPersistentData, - {}, - "Our persistent path should be flushed" - ); - }); - - await SpecialPowers.popPrefEnv(); -}); - -/** - * Tests that the persistent data for embedded components is flushed if the dialog is cancelled - */ -add_task( - async function test_embedded_component_persistent_data_filepicker_cancelled() { - await SpecialPowers.pushPrefEnv({ - set: [[SCHEDULED_BACKUPS_ENABLED_PREF, false]], - }); - - await BrowserTestUtils.withNewTab( - "about:preferences#sync", - async browser => { - const mockCustomParentDir = await IOUtils.createUniqueDirectory( - PathUtils.tempDir, - "our-dummy-folder" - ); - let { filePickerShownPromise } = - await setup_mockFilePicker(mockCustomParentDir); - - let settings = browser.contentDocument.querySelector("backup-settings"); - let turnOnButton = settings.scheduledBackupsButtonEl; - - Assert.ok( - turnOnButton, - "Button to turn on scheduled backups should be found" - ); - - turnOnButton.click(); - - await settings.updateComplete; - let turnOnScheduledBackups = settings.turnOnScheduledBackupsEl; - - // for the purposes of this test, we will act like we are an embedded component - turnOnScheduledBackups.embeddedFxBackupOptIn = true; - - // First verify the default input value and dir path button - let filePathButton = turnOnScheduledBackups.filePathButtonEl; - const waitForStateUpdate = () => - BrowserTestUtils.waitForEvent(window, "BackupUI:StateWasUpdated"); - - let stateUpdatePromise = waitForStateUpdate(); - - Assert.ok( - filePathButton, - "Button for choosing a file path should be found" - ); - filePathButton.click(); - - await filePickerShownPromise; - await stateUpdatePromise; - await turnOnScheduledBackups.updateComplete; - - Assert.equal( - settings.backupServiceState.embeddedComponentPersistentData.path, - mockCustomParentDir, - "Our persistent path should be set correctly" - ); - - stateUpdatePromise = waitForStateUpdate(); - - let dialog = settings.turnOnScheduledBackupsDialogEl; - let closedPromise = BrowserTestUtils.waitForEvent(dialog, "close"); - dialog.close(); - await closedPromise; - await stateUpdatePromise; - - Assert.deepEqual( - settings.backupServiceState.embeddedComponentPersistentData, - {}, - "Our persistent path should be flushed" - ); - } - ); - - await SpecialPowers.popPrefEnv(); - } -); diff --git a/browser/components/backup/tests/chrome/chrome.toml b/browser/components/backup/tests/chrome/chrome.toml @@ -3,7 +3,6 @@ prefs = [ "browser.backup.scheduled.enabled=false", "browser.backup.archive.enabled=true", "browser.backup.restore.enabled=true", - "privacy.sanitize.sanitizeOnShutdown=false" ] support-files = ["head.js"] diff --git a/browser/components/backup/tests/chrome/head.js b/browser/components/backup/tests/chrome/head.js @@ -6,26 +6,6 @@ const MOCK_PASSWORD = "mckP@ss3x2 fake_password"; /** - * Creates a default backupServiceState object with common properties. - * This is used in tests to avoid repetition of the defaultParent structure. - * - * @param {object} overrides - Properties to override or add to the default state - * @returns {object} The complete backupServiceState object - */ -function createBackupServiceState(overrides = {}) { - const testDefaultName = "test-default-path"; - return { - defaultParent: { - path: PathUtils.join(PathUtils.tempDir, testDefaultName), - fileName: testDefaultName, - }, - archiveEnabledStatus: true, - restoreEnabledStatus: true, - ...overrides, - }; -} - -/** * Dispatches a custom event "ValidPasswordsDetected" or "InvalidPasswordsDetected" from * the password-validation-inputs element within a parent element. * Pass "ValidPasswordsDetected" to simulate when a user meets password requirements diff --git a/browser/components/backup/tests/chrome/test_backup_settings.html b/browser/components/backup/tests/chrome/test_backup_settings.html @@ -5,7 +5,6 @@ <title>Tests for the BackupSettings component</title> <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> - <script type="application/javascript" src="head.js"></script> <script src="chrome://browser/content/backup/backup-settings.mjs" type="module" @@ -18,6 +17,7 @@ const { BrowserTestUtils } = ChromeUtils.importESModule( "resource://testing-common/BrowserTestUtils.sys.mjs" ); + const testDefaultName = "test-default-path"; /** * Tests that adding a backup-settings element to the DOM causes it to @@ -42,9 +42,15 @@ add_task(async function test_turnOnScheduledBackupsDialog() { let settings = document.getElementById("test-backup-settings"); - settings.backupServiceState = createBackupServiceState(); + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + } + } await settings.updateComplete; + let turnOnButton = settings.scheduledBackupsButtonEl; let dialog = settings.turnOnScheduledBackupsDialogEl; @@ -74,9 +80,13 @@ */ add_task(async function test_turnOffScheduledBackupsDialog() { let settings = document.getElementById("test-backup-settings"); - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, scheduledBackupsEnabled: true, - }); + } await settings.updateComplete; @@ -109,10 +119,14 @@ */ add_task(async function test_disableBackupEncryptionDialog() { let settings = document.getElementById("test-backup-settings"); - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, scheduledBackupsEnabled: true, encryptionEnabled: true, - }); + } await settings.updateComplete; @@ -146,20 +160,28 @@ add_task(async function test_lastBackupTimestamp() { let settings = document.getElementById("test-backup-settings"); - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, lastBackupDate: null, lastBackupFileName: "", - }); + }; await settings.updateComplete; let backupInfo = settings.shadowRoot.querySelector("#last-backup-info"); ok(!backupInfo, "Last backup info was not rendered."); const lastBackupTimestamp = 1719769205; const lastBackupFileName = "SomeBackup.html" - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, lastBackupDate: lastBackupTimestamp, lastBackupFileName, - }); + }; await settings.updateComplete; backupInfo = settings.shadowRoot.querySelector("#last-backup-info"); @@ -186,20 +208,28 @@ add_task(async function test_backupLocation() { let settings = document.getElementById("test-backup-settings"); - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, lastBackupDate: null, lastBackupFileName: "", scheduledBackupsEnabled: false, - }); + }; await settings.updateComplete; let backupLocationControl = settings.shadowRoot.querySelector("#last-backup-location-control"); ok(!backupLocationControl, "Last backup location control was not rendered."); const backupDirPath = "Some/Expected/Path"; - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, scheduledBackupsEnabled: true, backupDirPath, - }); + }; await settings.updateComplete; backupLocationControl = settings.shadowRoot.querySelector("#last-backup-location-control"); @@ -217,10 +247,14 @@ let content = document.getElementById("content"); const backupDirPath = "Some/Expected/Path"; - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, scheduledBackupsEnabled: true, backupDirPath, - }); + }; let locationShowButton = settings.shadowRoot.querySelector("#backup-location-show"); ok(locationShowButton, "Backup location show button exists."); @@ -238,10 +272,14 @@ let content = document.getElementById("content"); const backupDirPath = "Some/Expected/Path"; - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, scheduledBackupsEnabled: true, backupDirPath, - }); + }; let locationEditButton = settings.shadowRoot.querySelector("#backup-location-edit"); ok(locationEditButton, "Backup location edit button exists."); @@ -259,9 +297,13 @@ let settings = document.getElementById("test-backup-settings"); // First check visibility when scheduled backups are disabled - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, scheduledBackupsEnabled: false, - }); + } await settings.updateComplete; ok( @@ -310,9 +352,13 @@ add_task(async function test_content_when_scheduled_backups_disabled() { let settings = document.getElementById("test-backup-settings"); - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, scheduledBackupsEnabled: false, - }); + } await settings.updateComplete; ok( @@ -338,9 +384,13 @@ add_task(async function test_content_when_scheduled_backups_enabled() { let settings = document.getElementById("test-backup-settings"); - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, testDefaultName), + fileName: testDefaultName, + }, scheduledBackupsEnabled: true, - }); + } await settings.updateComplete; ok( diff --git a/browser/components/backup/tests/chrome/test_trigger_create_backup.html b/browser/components/backup/tests/chrome/test_trigger_create_backup.html @@ -5,7 +5,6 @@ <title>Tests for the BackupSettings component</title> <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> - <script type="application/javascript" src="head.js"></script> <script src="chrome://browser/content/backup/backup-settings.mjs" type="module" @@ -24,26 +23,38 @@ add_task(async function test_backupTriggerStateChange() { let settings = document.getElementById("test-backup-settings"); - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, "test-default-path"), + fileName: "test-default-path", + }, backupInProgress: true, scheduledBackupsEnabled: false, - }); + } await settings.updateComplete; ok(!settings.triggerBackupButtonEl, "Trigger backup button is not visible when backup is off"); - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, "test-default-path"), + fileName: "test-default-path", + }, backupInProgress: true, scheduledBackupsEnabled: true, - }); + } await settings.updateComplete; ok(settings.triggerBackupButtonEl.disabled, "Trigger backup button should be disabled when backing up"); - settings.backupServiceState = createBackupServiceState({ + settings.backupServiceState = { + defaultParent: { + path: PathUtils.join(PathUtils.tempDir, "test-default-path"), + fileName: "test-default-path", + }, backupInProgress: false, scheduledBackupsEnabled: true, - }); + } await settings.updateComplete; ok(!settings.triggerBackupButtonEl.enabled, "Trigger backup button should be enabled"); diff --git a/browser/components/backup/tests/xpcshell/test_BackupService_retryHeuristic.js b/browser/components/backup/tests/xpcshell/test_BackupService_retryHeuristic.js @@ -19,20 +19,18 @@ const BACKUP_DEBUG_INFO_PREF_NAME = "browser.backup.backup-debug-info"; const BACKUP_DEFAULT_LOCATION_PREF_NAME = "browser.backup.location"; function bsInProgressStateUpdate(bs, isBackupInProgress) { - // Check if already in desired state - if (bs.state.backupInProgress === isBackupInProgress) { - return Promise.resolve(); - } - return new Promise(resolve => { - const listener = () => { - if (bs.state.backupInProgress === isBackupInProgress) { - bs.removeEventListener("BackupService:StateUpdate", listener); - resolve(); - } - }; - - bs.addEventListener("BackupService:StateUpdate", listener); + bs.addEventListener( + "BackupService:StateUpdate", + () => { + if (bs.state.backupInProgress == isBackupInProgress) { + resolve(); + } else { + Assert.ok(false, "Failure in waiting for state updates"); + } + }, + { once: true } + ); }); } diff --git a/browser/components/backup/tests/xpcshell/test_BackupService_wrongPassword.js b/browser/components/backup/tests/xpcshell/test_BackupService_wrongPassword.js @@ -7,7 +7,7 @@ ChromeUtils.defineESModuleGetters(this, { ERRORS: "chrome://browser/content/backup/backup-constants.mjs", }); -let bs; +const bs = new BackupService({ FakeBackupResource1 }); const correctPassword = "correcthorsebatterystaple"; const incorrectPassword = "Tr0ub4dor&3"; let testBackupDirPath; @@ -16,7 +16,6 @@ let testBackupPath; add_setup(async function () { setupProfile(); - bs = new BackupService({ FakeBackupResource1 }); let sandbox = sinon.createSandbox(); let fakeManifestEntry = { fake: "test" }; sandbox diff --git a/browser/components/storybook/component-status/components.json b/browser/components/storybook/component-status/components.json @@ -1,5 +1,5 @@ { - "generatedAt": "2025-11-14T18:02:05.239Z", + "generatedAt": "2025-11-12T19:18:35.085Z", "count": 29, "items": [ {