This patch updates test_backup.py to write some testing data into various data stores
that BackupService is backing up, create a backup, recover from that backup, and check
to see if the written data exists in the recovered profile.
This isn't exactly exhaustive - there are a number of data stores that aren't accounted
for here yet. Chiefly AddonsBackupResource and SessionStoreBackupResource (bug 1894004),
but also:
1. FxA sign-in status
2. Logins backups
3. Site Security Service State
4. ProfileAge data
5. WebRTC device ID mappings
6. Favicons
7. XUL Store data
8. Content preferences
9. Containers preferences
10. File handler preferences
11. Search preferences
12. user.js and chrome/ customizations
Still, this is a start, and certainly better than nothing. Bug 1894089 has been filed
to add more data to test the listed 12 items.
Differential Revision: https://phabricator.services.mozilla.com/D208939
This Promise is mainly for use by Marionette tests to know when to check
data stores that might have been updated by postRecovery steps.
Differential Revision: https://phabricator.services.mozilla.com/D208938
This test can be run via:
./mach marionette-test browser/components/backup/test/marionette/test_backup.py
This also makes it so that BackupResource.copySqliteDatabases does not throw if
one of the passed in database files doesn't exist - it'll just ignore it and
move on. This required me to update some tests in order to create some fake
SQLite databases to ensure that the fake Sqlite connection was made and the
backup stub was called for the SQLite databases being copied.
Finally, this also fixes something I noticed - some of our BackupResource's
weren't returning null or objects as their ManifestEntry. This fixes that
and adds tests to cover that case.
Differential Revision: https://phabricator.services.mozilla.com/D207811
- Adds a static `priority` getter in BackupResource base class, which defaults to 0.
- Determine the order resources will be backed up sorted on that priority in `createBackup`, defaulting to unordered.
- Sets `PlacesBackupResource` position 1 so it will run first.
Differential Revision: https://phabricator.services.mozilla.com/D207934
Implements `PlacesBackupResource.backup` to store a copy of `places.sqlite` and `favicons.sqlite` in the staging folder.
If users don't want history remembered or use permanent private browsing mode, we will backup bookmarks instead to a file called `bookmarks.json`. Automatic backup is not yet implemented, so to test changes locally, go to `chrome://browser/content/backup/debug.html` to view where we store the staging folder and to manually run the backup methods for all available backup resources.
Backup files for `PlacesBackupResource` should be under the `places` subfolder in the staging folder.
Differential Revision: https://phabricator.services.mozilla.com/D206532
- Adds `CookiesBackupResource`, `FormHistoryBackupResource` and `SessionsStoreBackupResource` classes with measurement methods for those resources.
- Exports `BYTES_IN_KB` and new `bytesToFuzzyKilobytes` methods from `BackupResource`
- Fix filename for `BackupResource` tests.
Differential Revision: https://phabricator.services.mozilla.com/D205254
- Adds `CookiesBackupResource`, `FormHistoryBackupResource` and `SessionsStoreBackupResource` classes with measurement methods for those resources.
- Exports `BYTES_IN_KB` and new `bytesToFuzzyKilobytes` methods from `BackupResource`
- Fix filename for `BackupResource` tests.
Differential Revision: https://phabricator.services.mozilla.com/D205254
This also fixes a small typo that prevented us from properly being able
to override the built-in default BackupResources while testing.
Differential Revision: https://phabricator.services.mozilla.com/D204966
Adds a `BackupResource` abstract class to be extended by more specific resource handlers and a `BackupResources` module which resources can be registered with.
The BackupResource base includes helpers to get the size of files and directories.
All registed resources will be provided to the `BackupService` constructor for it instantiate them.
Differential Revision: https://phabricator.services.mozilla.com/D203795
Adds a `BackupResource` abstract class to be extended by more specific resource handlers and a `BackupResources` module which resources can be registered with.
The BackupResource base includes helpers to get the size of files and directories.
All registed resources will be provided to the `BackupService` constructor for it instantiate them.
Differential Revision: https://phabricator.services.mozilla.com/D203795