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
Currently this only gets packaged for Nightly builds. You can access the page
by visiting chrome://browser/content/backup/debug.html.
This also fixes an issue where we weren't clearing the staging folder
recursively if it pre-existed.
Differential Revision: https://phabricator.services.mozilla.com/D206067
Currently this only gets packaged for Nightly builds. You can access the page
by visiting chrome://browser/content/backup/debug.html.
This also fixes an issue where we weren't clearing the staging folder
recursively if it pre-existed.
Differential Revision: https://phabricator.services.mozilla.com/D206067
- 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