CI: Windows smoke test of the installed app (#19) #30

Merged
jared merged 6 commits from ci-windows-smoke into main 2026-09-30 10:59:38 -04:00
Showing only changes of commit 12ad4bf681 - Show all commits
+11 -5
View File
@@ -1294,9 +1294,12 @@ pub fn run() {
/// ///
/// cinny-desktop #19: `LOTUS_WEBVIEW2_DEBUG_PORT=<port>` in the environment /// cinny-desktop #19: `LOTUS_WEBVIEW2_DEBUG_PORT=<port>` in the environment
/// opens WebView2's DevTools port on localhost so the Windows smoke test can /// opens WebView2's DevTools port on localhost so the Windows smoke test can
/// drive the installed app. WebView2's own `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS` /// drive the installed app, and gives it Chromium's fake capture devices (the
/// doesn't apply because the app sets its arguments explicitly. Off unless the /// CI VM has no microphone; permission requests still go through the app's
/// variable holds a valid port; only whoever launches the app can set it. /// real PermissionRequested handler). WebView2's own
/// `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS` doesn't apply because the app sets
/// its arguments explicitly. Off unless the variable holds a valid port; only
/// whoever launches the app can set it.
pub(crate) fn webview2_browser_args(debug_port: Option<&str>) -> String { pub(crate) fn webview2_browser_args(debug_port: Option<&str>) -> String {
let mut args = String::from( let mut args = String::from(
"--disable-features=msWebOOUI,msPdfOOUI --disable-background-timer-throttling --disable-renderer-backgrounding --disable-backgrounding-occluded-windows", "--disable-features=msWebOOUI,msPdfOOUI --disable-background-timer-throttling --disable-renderer-backgrounding --disable-backgrounding-occluded-windows",
@@ -1306,7 +1309,9 @@ pub(crate) fn webview2_browser_args(debug_port: Option<&str>) -> String {
.filter(|p| *p >= 1024) .filter(|p| *p >= 1024)
{ {
eprintln!("webview: DevTools port {port} open (LOTUS_WEBVIEW2_DEBUG_PORT)"); eprintln!("webview: DevTools port {port} open (LOTUS_WEBVIEW2_DEBUG_PORT)");
args.push_str(&format!(" --remote-debugging-port={port}")); args.push_str(&format!(
" --remote-debugging-port={port} --use-fake-device-for-media-stream"
));
} }
args args
} }
@@ -1320,7 +1325,8 @@ mod webview2_args_tests {
let base = webview2_browser_args(None); let base = webview2_browser_args(None);
assert!(base.contains("--disable-renderer-backgrounding")); assert!(base.contains("--disable-renderer-backgrounding"));
assert!(!base.contains("remote-debugging")); assert!(!base.contains("remote-debugging"));
assert!(webview2_browser_args(Some("9222")).ends_with(" --remote-debugging-port=9222")); assert!(webview2_browser_args(Some("9222"))
.ends_with(" --remote-debugging-port=9222 --use-fake-device-for-media-stream"));
for bad in ["", "abc", "80", "70000", "9222 --evil", "-1"] { for bad in ["", "abc", "80", "70000", "9222 --evil", "-1"] {
assert_eq!(webview2_browser_args(Some(bad)), base, "{bad}"); assert_eq!(webview2_browser_args(Some(bad)), base, "{bad}");
} }