Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
test(recording): recover every track's persisted start time
Richie McIlroyc25246b904b3
diff --git a/crates/recording/tests/recovery.rs b/crates/recording/tests/recovery.rsindex e6729b4cc..590815539 100644--- a/crates/recording/tests/recovery.rs+++ b/crates/recording/tests/recovery.rs@@ -2299,7 +2299,13 @@ fn recovery_aligns_tracks_with_the_start_times_persisted_while_recording() {let recording = TestRecording::new().unwrap();let display_dir = recording.create_display_dir(0).unwrap();+ let camera_dir = recording.create_segment_dir(0).unwrap().join("camera");+ std::fs::create_dir(&camera_dir).unwrap();write_synthetic_fragments(&display_dir, 180, Duration::from_secs(2));+ write_synthetic_fragments(&camera_dir, 180, Duration::from_secs(2));+ let segment = recording.path().join("content/segments/segment-0");+ write_recovery_wav(&segment.join("audio-input.m4a"));+ write_recovery_wav(&segment.join("system_audio.m4a"));// What the recorder leaves: an in-progress meta without segments, plus// the start times it persisted beside the segment.@@ -2327,7 +2333,7 @@ fn recovery_aligns_tracks_with_the_start_times_persisted_while_recording() {.parent().unwrap().join(cap_recording::recovery::SEGMENT_START_TIMES_FILE),- br#"{"display":0.412,"camera":null,"mic":0.25,"system_audio":null}"#,+ br#"{"display":0.412,"camera":0.38,"mic":0.25,"system_audio":0.31}"#,).unwrap();@@ -2337,5 +2343,12 @@ fn recovery_aligns_tracks_with_the_start_times_persisted_while_recording() {let StudioRecordingMeta::MultipleSegments { inner } = recovered.meta else {panic!("segmented meta expected");};- assert_eq!(inner.segments[0].display.start_time, Some(0.412));+ let segment = &inner.segments[0];+ assert_eq!(segment.display.start_time, Some(0.412));+ assert_eq!(segment.camera.as_ref().unwrap().start_time, Some(0.38));+ assert_eq!(segment.mic.as_ref().unwrap().start_time, Some(0.25));+ assert_eq!(+ segment.system_audio.as_ref().unwrap().start_time,+ Some(0.31)+ );}