1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-23 00:50:08 +00:00

Fix cleanup regressions and analyze navigation

Refs #605 #607 #608 #609 #610
This commit is contained in:
Tw93
2026-03-21 13:04:48 +08:00
parent d51e1a621d
commit d6b9d9f3f3
13 changed files with 692 additions and 199 deletions

View File

@@ -141,6 +141,54 @@ EOF
[[ "$output" == *"Font cache cleared"* ]]
}
@test "opt_font_cache_rebuild skips when Firefox helpers are running" {
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" bash --noprofile --norc <<'EOF'
set -euo pipefail
source "$PROJECT_ROOT/lib/core/common.sh"
source "$PROJECT_ROOT/lib/optimize/tasks.sh"
pgrep() {
case "$*" in
*"Firefox|org\\.mozilla\\.firefox|firefox .*contentproc|firefox .*plugin-container|firefox .*crashreporter"*)
return 0
;;
*)
return 1
;;
esac
}
export -f pgrep
opt_font_cache_rebuild
EOF
[ "$status" -eq 0 ]
[[ "$output" == *"Skipped font cache rebuild because browsers or helpers are still running: Firefox"* ]]
}
@test "browser_family_is_running does not treat generic renderer helpers as Zen Browser" {
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" bash --noprofile --norc <<'EOF'
set -euo pipefail
source "$PROJECT_ROOT/lib/core/common.sh"
source "$PROJECT_ROOT/lib/optimize/tasks.sh"
pgrep() {
case "$*" in
*"renderer|gpu"*)
return 0
;;
*)
return 1
;;
esac
}
export -f pgrep
if browser_family_is_running "Zen Browser"; then
echo "MATCHED"
fi
EOF
[ "$status" -eq 0 ]
[[ "$output" != *"MATCHED"* ]]
}
@test "opt_dock_refresh clears cache files" {
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" MOLE_DRY_RUN=1 bash --noprofile --norc <<'EOF'
set -euo pipefail