//! Contract tests for launcher-owned relay process lifetime. //! //! Scope: static guardrails around launcher runtime process management. //! Targets: `client/src/launcher/ui_runtime.rs`. //! Why: the launcher is the owner of the live relay. If it crashes, audio, //! video, and input streams must not keep running as leaked child processes. const UI_RUNTIME_SRC: &str = include_str!("../../client/src/launcher/ui_runtime.rs"); const LAUNCHER_MOD_SRC: &str = include_str!("../../client/src/launcher/mod.rs"); const MAIN_SRC: &str = include_str!("../../client/src/main.rs"); #[test] fn relay_child_gets_parent_identity_from_launcher() { assert!(UI_RUNTIME_SRC.contains("\"LESAVKA_LAUNCHER_PARENT_PID\"")); assert!(UI_RUNTIME_SRC.contains("std::process::id().to_string()")); assert!(UI_RUNTIME_SRC.contains("LESAVKA_LAUNCHER_PARENT_START_TICKS")); assert!(UI_RUNTIME_SRC.contains("launcher_parent_start_ticks()")); } #[test] fn relay_child_starts_safe_parent_watchdog_on_boot() { assert!(MAIN_SRC.contains("launcher::start_launcher_child_parent_watchdog_from_env();")); assert!(LAUNCHER_MOD_SRC.contains("start_launcher_child_parent_watchdog_from_env")); assert!(LAUNCHER_MOD_SRC.contains("launcher-parent-watchdog")); assert!(LAUNCHER_MOD_SRC.contains("std::process::exit(0);")); assert!(LAUNCHER_MOD_SRC.contains("proc_stat_start_ticks")); } #[test] fn relay_address_entry_is_locked_while_relay_is_live() { assert!(UI_RUNTIME_SRC.contains("widgets.server_entry.set_sensitive(!relay_live);")); assert!(UI_RUNTIME_SRC.contains("\"Connect\"")); assert!(UI_RUNTIME_SRC.contains("\"Disconnect\"")); }