feat(browser): auto-commit con 178 cambios
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user