MCPcopy
hub / github.com/nextlevelbuilder/goclaw / TestResolveRemoteCDP_InvalidJSON

Function TestResolveRemoteCDP_InvalidJSON

pkg/browser/browser_test.go:128–139  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func TestResolveRemoteCDP_InvalidJSON(t *testing.T) {
129 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
130 w.Write([]byte("not json"))
131 }))
132 defer srv.Close()
133
134 wsURL := "ws://" + srv.Listener.Addr().String()
135 _, err := resolveRemoteCDP(wsURL)
136 if err == nil {
137 t.Fatal("expected error for invalid JSON, got nil")
138 }
139}
140
141func TestResolveRemoteCDP_ConnectionRefused(t *testing.T) {
142 // Use a port that's definitely not listening.

Callers

nothing calls this directly

Calls 4

resolveRemoteCDPFunction · 0.85
CloseMethod · 0.65
WriteMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected