'Real' backup state can sometimes leak to UI code during tests even though it's stubbed out
Categories
(Firefox :: Profile Backup, task)
Tracking
()
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.
| Assignee | ||
Comment 1•1 day ago
|
||
(this only affects tests)
| Assignee | ||
Comment 2•1 day ago
|
||
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.
Description
•