feat: inspect windows browser process identity
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
//go:build windows
|
||||
|
||||
package browser
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestWindowsProcessInspectorReadsCurrentProcess(t *testing.T) {
|
||||
inspector := NewWindowsProcessInspector()
|
||||
identity, err := inspector.Inspect(context.Background(), os.Getpid())
|
||||
if err != nil {
|
||||
t.Fatalf("Inspect(current process) error = %v", err)
|
||||
}
|
||||
if identity.PID != os.Getpid() || identity.Executable == "" {
|
||||
t.Fatalf("identity = %+v", identity)
|
||||
}
|
||||
alive, err := inspector.Alive(context.Background(), os.Getpid())
|
||||
if err != nil || !alive {
|
||||
t.Fatalf("Alive(current process) = %v, %v", alive, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user