Open Bug 2004791 Opened 1 day ago Updated 1 day ago

'Real' backup state can sometimes leak to UI code during tests even though it's stubbed out

Categories

(Firefox :: Profile Backup, task)

task

Tracking

()

ASSIGNED

People

(Reporter: dmcintosh, Assigned: dmcintosh)

Details

Attachments

(1 file)

For some reason mocking the backup state using BackupService.prototype doesn't always affect what the frontend sees, and sometimes the 'real' state can leak through and cause test failures.

See e.g. my confusion in https://phabricator.services.mozilla.com/D274841#inline-1497362, since that should have failed but instead it passed.

My plan is to fix this by stubbing out the state on the singleton instead, but if there's a better way to get at the root cause I'd be interested to hear it.

(this only affects tests)

Summary: 'Real' backup state can sometimes leak to UI code even though it's stubbed out → 'Real' backup state can sometimes leak to UI code during tests even though it's stubbed out

I'm not sure why this helps, but it does---it seems that the UI otherwise
gets the 'real' backup state, even though it's stubbed out. (I'm wondering
if the BackupService prototype is different at some important point...?)

This change makes the restore-from-backup test fail if
backupFileCoarseLocation is not present, which is what I was confused
about in

https://phabricator.services.mozilla.com/D274841#inline-1497362

It also resolves a failure in
test_turn_off_scheduled_backups_disables_encryption that would otherwise be
introduced in my patch for bug 1996249.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: