Host: the settings backup commands (collect, export, open, apply) are served for every app; SiteHooks::backup_drafts and backup_apply carry what only the app knows; commands::BACKUP, testkit::assert_backup_guards
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
198b1160f2
commit
409949edb9
5 changed files with 188 additions and 5 deletions
|
|
@ -259,6 +259,14 @@ pub fn assert_dev_guards() {
|
|||
}
|
||||
}
|
||||
|
||||
/// The backup commands' wrappers check their caller first. Runs against the host's source.
|
||||
pub fn assert_backup_guards() {
|
||||
let source = include_str!("backup_commands.rs");
|
||||
for command in commands::BACKUP {
|
||||
assert_guarded(source, command, "shell_only(&webview)?");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
@ -271,6 +279,7 @@ mod tests {
|
|||
assert_update_guards();
|
||||
assert_sync_guards();
|
||||
assert_dev_guards();
|
||||
assert_backup_guards();
|
||||
}
|
||||
|
||||
fn caps_with(shell_extra: &str, tab_extra: &str, site_extra: &str) -> Capabilities {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue