8742cb25be
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
26 lines
796 B
Go
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)
|
|
}
|
|
})
|
|
}
|