feat: add local cdp startup and external association

This commit is contained in:
QiuSW
2026-07-25 15:53:31 +08:00
parent 972c637716
commit 4063b851eb
17 changed files with 845 additions and 158 deletions
+19
View File
@@ -60,6 +60,25 @@ func TestBuildArgsAllowsDefaultBrowserPage(t *testing.T) {
}
}
func TestBuildArgsAddsLoopbackRemoteDebuggingArguments(t *testing.T) {
profile := filepath.Join(t.TempDir(), "profile")
args, err := BuildArgs(domain.LaunchSpec{Kind: domain.BrowserChrome, UserDataDir: profile, RemoteDebugPort: 9666})
if err != nil {
t.Fatal(err)
}
for _, want := range []string{"--remote-debugging-address=127.0.0.1", "--remote-debugging-port=9666"} {
found := false
for _, arg := range args {
if arg == want {
found = true
}
}
if !found {
t.Fatalf("args = %#v, missing %q", args, want)
}
}
}
func TestDiscovererResolvesConfiguredAndStandardPaths(t *testing.T) {
root := t.TempDir()
chrome := filepath.Join(root, `Google\Chrome\Application\chrome.exe`)