//! Tests for MpvBackend to prevent regressions //! //! These tests are designed to catch common issues like: //! - Tokio runtime panics when spawning async tasks from std::thread //! - Position update thread failures //! - Event emission issues //! //! TRACES: UR-003, UR-004 | IR-003 | IT-003, IT-004 #[cfg(test)] mod tests { use crate::utils::lock::MutexSafe; use std::sync::{Arc, Mutex}; use tokio::sync::Mutex as TokioMutex; /// Every property the event loop *handles* must also be *observed*. /// /// libmpv only delivers `PropertyChange` for properties registered with /// `mpv_observe_property`. A `match` arm for an unobserved property is /// unreachable code that looks exactly like working code: the handler is /// right there, so the behaviour reads as implemented. /// /// This cost a real bug. `pause` was handled and never observed, so /// `StateChanged` was never emitted on pause or resume. It stayed invisible /// while Linux video played in the webview, because the `