Only offer webcam recording when available
This commit is contained in:
@@ -161,6 +161,11 @@ assertEqual(
|
||||
'omarchy-hw-laptop',
|
||||
'menu only shows Mirror Display on laptops'
|
||||
)
|
||||
assertEqual(
|
||||
defaultById['trigger.capture.screenrecord.webcam'].when,
|
||||
'omarchy-hw-webcam',
|
||||
'menu only shows webcam screen recording when a webcam is available'
|
||||
)
|
||||
assert(
|
||||
/font\.family: row\.iconFont\.length > 0 \? row\.iconFont : root\.fontFamily/.test(menuQml),
|
||||
'menu rows support per-icon font families'
|
||||
|
||||
@@ -13,6 +13,8 @@ mkdir -p "$stub_bin"
|
||||
cat >"$stub_bin/v4l2-ctl" <<'SH'
|
||||
#!/bin/bash
|
||||
|
||||
[[ ${OMARCHY_TEST_NO_WEBCAM:-false} == "true" ]] && exit 0
|
||||
|
||||
printf '%s\n' "Built-in Webcam: Integrated Camera"
|
||||
printf '\t%s\n' "/dev/video0"
|
||||
printf '\t%s\n' "/dev/video1"
|
||||
@@ -47,6 +49,18 @@ export OMARCHY_TEST_MENU_ARGS="$tmp_dir/menu-args"
|
||||
export OMARCHY_TEST_RECORDER_ARGS="$tmp_dir/recorder-args"
|
||||
export OMARCHY_TEST_NOTIFICATION_ARGS="$tmp_dir/notification-args"
|
||||
|
||||
if "$ROOT/bin/omarchy-hw-webcam"; then
|
||||
pass "webcam hardware detection succeeds when a video device is available"
|
||||
else
|
||||
fail "webcam hardware detection succeeds when a video device is available"
|
||||
fi
|
||||
|
||||
if OMARCHY_TEST_NO_WEBCAM=true "$ROOT/bin/omarchy-hw-webcam"; then
|
||||
fail "webcam hardware detection fails when no video device is available"
|
||||
else
|
||||
pass "webcam hardware detection fails when no video device is available"
|
||||
fi
|
||||
|
||||
"$ROOT/bin/omarchy-capture-screenrecording-with-webcam"
|
||||
|
||||
expected_menu_args="$tmp_dir/expected-menu-args"
|
||||
|
||||
Reference in New Issue
Block a user