diff options
Diffstat (limited to 'tests/test-video-audio-recording-process-cleanup.el')
| -rw-r--r-- | tests/test-video-audio-recording-process-cleanup.el | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/tests/test-video-audio-recording-process-cleanup.el b/tests/test-video-audio-recording-process-cleanup.el index d1cd442c..42b5b96d 100644 --- a/tests/test-video-audio-recording-process-cleanup.el +++ b/tests/test-video-audio-recording-process-cleanup.el @@ -166,7 +166,9 @@ so ffmpeg sees EOF on its video input pipe and starts finalizing the file." 0)) ((symbol-function 'start-process-shell-command) (lambda (_name _buffer _command) - (make-process :name "fake-video" :command '("sleep" "1000"))))) + (make-process :name "fake-video" :command '("sleep" "1000")))) + ((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) (cj/ffmpeg-record-video video-recordings-dir) (should pkill-called) (should (member "-INT" pkill-args)) @@ -186,7 +188,9 @@ so ffmpeg sees EOF on its video input pipe and starts finalizing the file." 0)) ((symbol-function 'start-process-shell-command) (lambda (_name _buffer _command) - (make-process :name "fake-video" :command '("sleep" "1000"))))) + (make-process :name "fake-video" :command '("sleep" "1000")))) + ((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) (cj/ffmpeg-record-video video-recordings-dir) (should-not pkill-called))) (test-cleanup-teardown))) @@ -299,13 +303,15 @@ This is an integration test that requires wf-recorder and Wayland." (skip-unless (cj/recording--wayland-p)) (test-cleanup-setup) (unwind-protect - (let ((initial-count (test-cleanup--count-wf-recorder-processes))) - (cj/ffmpeg-record-video video-recordings-dir) - (sit-for 1.0) - (should (> (test-cleanup--count-wf-recorder-processes) initial-count)) - (cj/video-recording-stop) - (sit-for 1.0) - (should (= (test-cleanup--count-wf-recorder-processes) initial-count))) + (cl-letf (((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) + (let ((initial-count (test-cleanup--count-wf-recorder-processes))) + (cj/ffmpeg-record-video video-recordings-dir) + (sit-for 1.0) + (should (> (test-cleanup--count-wf-recorder-processes) initial-count)) + (cj/video-recording-stop) + (sit-for 1.0) + (should (= (test-cleanup--count-wf-recorder-processes) initial-count)))) (test-cleanup-teardown) (ignore-errors (call-process "pkill" nil nil nil "-INT" "wf-recorder")))) @@ -317,7 +323,8 @@ This is an integration test that requires wf-recorder and Wayland." (skip-unless (cj/recording--wayland-p)) (test-cleanup-setup) (unwind-protect - (progn + (cl-letf (((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) ;; Create an orphan wf-recorder (simulating a crash) (start-process "orphan-wf" nil "wf-recorder" "-c" "libx264" "-m" "matroska" "-f" "/dev/null") (sit-for 0.5) @@ -342,13 +349,15 @@ This is an integration test that requires wf-recorder and Wayland." (skip-unless (cj/recording--wayland-p)) (test-cleanup-setup) (unwind-protect - (let ((initial-count (test-cleanup--count-wf-recorder-processes))) - (dotimes (_ 3) - (cj/ffmpeg-record-video video-recordings-dir) - (sit-for 0.5) - (cj/video-recording-stop) - (sit-for 0.5)) - (should (= (test-cleanup--count-wf-recorder-processes) initial-count))) + (cl-letf (((symbol-function 'cj/recording--validate-system-audio) + (lambda () nil))) + (let ((initial-count (test-cleanup--count-wf-recorder-processes))) + (dotimes (_ 3) + (cj/ffmpeg-record-video video-recordings-dir) + (sit-for 0.5) + (cj/video-recording-stop) + (sit-for 0.5)) + (should (= (test-cleanup--count-wf-recorder-processes) initial-count)))) (test-cleanup-teardown) (ignore-errors (call-process "pkill" nil nil nil "-INT" "wf-recorder")))) |
