feat: inspect windows browser process identity

This commit is contained in:
QiuSW
2026-07-22 14:59:57 +08:00
parent 23be05210b
commit d6f6bb0f2c
8 changed files with 370 additions and 3 deletions
@@ -0,0 +1,19 @@
package browser
import (
"testing"
"chub/internal/domain"
)
func TestExecutableMatchesKind(t *testing.T) {
if !executableMatchesKind(`C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe`, domain.BrowserChrome) {
t.Fatal("Chrome executable was not recognized")
}
if !executableMatchesKind(`C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe`, domain.BrowserEdge) {
t.Fatal("Edge executable was not recognized")
}
if executableMatchesKind("other.exe", domain.BrowserChrome) {
t.Fatal("unrelated executable was recognized")
}
}