Simplify room events

This commit is contained in:
Antonio Scandurra 2022-10-24 10:53:44 +02:00
parent f99d70500c
commit a8bd234aa4
3 changed files with 16 additions and 27 deletions

View file

@ -203,16 +203,15 @@ async fn test_basic_calls(
assert_eq!(events_b.borrow().len(), 1);
let event = events_b.borrow().first().unwrap().clone();
if let call::room::Event::RemoteVideoTrackShared {
participant_id,
track_id,
} = event
{
if let call::room::Event::RemoteVideoTracksChanged { participant_id } = event {
assert_eq!(participant_id, client_a.peer_id().unwrap());
room_b.read_with(cx_b, |room, _| {
assert!(room.remote_participants()[&client_a.peer_id().unwrap()]
.tracks
.contains_key(&track_id));
assert_eq!(
room.remote_participants()[&client_a.peer_id().unwrap()]
.tracks
.len(),
1
);
});
} else {
panic!("unexpected event")