MCPcopy Create free account
hub / github.com/imroc/req / TestFramerWriteReadWindowUpdate

Function TestFramerWriteReadWindowUpdate

internal/http2/frame_test.go:134–154  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

132}
133
134func TestFramerWriteReadWindowUpdate(t *testing.T) {
135 var buf bytes.Buffer
136 fw := NewFramer(&buf, nil)
137 fw.WriteWindowUpdate(1, 65535)
138
139 fr := NewFramer(nil, &buf)
140 f, err := fr.ReadFrame()
141 if err != nil {
142 t.Fatalf("ReadFrame failed: %v", err)
143 }
144 wf, ok := f.(*WindowUpdateFrame)
145 if !ok {
146 t.Fatalf("expected *WindowUpdateFrame, got %T", f)
147 }
148 if wf.StreamID != 1 {
149 t.Fatalf("StreamID = %d, want 1", wf.StreamID)
150 }
151 if wf.Increment != 65535 {
152 t.Fatalf("Increment = %d, want 65535", wf.Increment)
153 }
154}
155
156func TestFramerWriteReadGoAway(t *testing.T) {
157 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 3

WriteWindowUpdateMethod · 0.95
ReadFrameMethod · 0.95
NewFramerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…