Host: the media panel's commands (gallery folders, previews, the clipboard history and its watcher) are served for every app that sets AppConfig::with_media; commands::MEDIA, media_commands::gallery_file/clip_image for an app's attach command, testkit::assert_media_guards
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
419f60b5b1
commit
873f8561ca
5 changed files with 312 additions and 5 deletions
|
|
@ -219,6 +219,14 @@ pub fn assert_store_guards() {
|
|||
}
|
||||
}
|
||||
|
||||
/// The media commands' wrappers check their caller first. Runs against the host's source.
|
||||
pub fn assert_media_guards() {
|
||||
let source = include_str!("media_commands.rs");
|
||||
for command in commands::MEDIA {
|
||||
assert_guarded(source, command, "shell_only(&webview)?");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
@ -226,6 +234,7 @@ mod tests {
|
|||
#[test]
|
||||
fn the_store_commands_check_their_caller_first() {
|
||||
assert_store_guards();
|
||||
assert_media_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