Files
fn_registry/functions/browser/cdp_close_test.go
T
egutierrez 8742cb25be feat(browser): auto-commit con 60 cambios
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-07 11:42:31 +02:00

26 lines
796 B
Go

package browser
import "testing"
// TestCdpCloseWrappers es un smoke nil-safe de los wrappers nombrados. Sin Chrome:
// con conexión nil y pid 0 no hay nada que cerrar ni matar, así que no debe error.
func TestCdpCloseWrappers(t *testing.T) {
t.Run("CdpDisconnect(nil) no error (nada que cerrar)", func(t *testing.T) {
if err := CdpDisconnect(nil); err != nil {
t.Errorf("CdpDisconnect(nil) = %v, esperaba nil", err)
}
})
t.Run("CdpQuit(nil, 0) no error (sin conexion ni pid)", func(t *testing.T) {
if err := CdpQuit(nil, 0); err != nil {
t.Errorf("CdpQuit(nil, 0) = %v, esperaba nil", err)
}
})
t.Run("CdpClose(nil, 0) sigue siendo no-op", func(t *testing.T) {
if err := CdpClose(nil, 0); err != nil {
t.Errorf("CdpClose(nil, 0) = %v, esperaba nil", err)
}
})
}