Files
fn_registry/functions/browser/cdp_new_tab_background_test.go
T
egutierrez 763e06c127 feat(browser): auto-commit con 178 cambios
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-20 18:22:23 +02:00

22 lines
686 B
Go

package browser
import "testing"
func TestCdpNewTabBackground_closedPort(t *testing.T) {
// Sin Chrome escuchando esperamos error de red al resolver /json/version,
// pero NO panic ni nil-deref. Puerto 1 garantizado cerrado.
_, err := CdpNewTabBackground("", 1, "https://example.com")
if err == nil {
t.Fatal("expected error talking to closed port")
}
}
func TestCdpNewTabBackground_emptyStartURLClosedPort(t *testing.T) {
// startURL vacio debe normalizarse a about:blank sin romper; con puerto
// cerrado seguimos esperando error de red, no panic.
_, err := CdpNewTabBackground("localhost", 1, "")
if err == nil {
t.Fatal("expected error talking to closed port")
}
}