mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-26 17:03:09 +00:00
test(appd): verify session transitions to Stopped when WEFT_RUNTIME_BIN absent
This commit is contained in:
parent
0fea8f58e4
commit
a5846c1317
1 changed files with 24 additions and 0 deletions
|
|
@ -542,6 +542,30 @@ mod tests {
|
|||
assert!(matches!(resp, Response::Error { .. }));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn session_stops_when_runtime_bin_absent() {
|
||||
unsafe { std::env::remove_var("WEFT_RUNTIME_BIN") };
|
||||
let reg = make_registry();
|
||||
let ack = dispatch(
|
||||
Request::LaunchApp {
|
||||
app_id: "com.test.nobinary".into(),
|
||||
surface_id: 0,
|
||||
},
|
||||
®,
|
||||
)
|
||||
.await;
|
||||
let session_id = match ack {
|
||||
Response::LaunchAck { session_id, .. } => session_id,
|
||||
_ => panic!("expected LaunchAck"),
|
||||
};
|
||||
tokio::task::yield_now().await;
|
||||
let state = reg.lock().await.state(session_id);
|
||||
assert!(
|
||||
matches!(state, AppStateKind::Stopped),
|
||||
"session should be Stopped when WEFT_RUNTIME_BIN is absent"
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn running_sessions_excludes_stopped() {
|
||||
let reg = make_registry();
|
||||
|
|
|
|||
Loading…
Reference in a new issue