This commit is contained in:
chhsiao90 2017-02-17 16:45:07 +08:00
Родитель 55b97d0a54
Коммит 29ced674e0
4 изменённых файлов: 5 добавлений и 75 удалений

Просмотреть файл

@ -170,11 +170,6 @@ func StreamStates() *spec.ClientTestGroup {
}
conn.WriteHeaders(hp)
err := spec.VerifyStreamClose(conn)
if err != nil {
return err
}
conn.WriteData(req.StreamID, true, []byte("test"))
return spec.VerifyConnectionError(conn, http2.ErrCodeStreamClosed)
@ -198,11 +193,6 @@ func StreamStates() *spec.ClientTestGroup {
}
conn.WriteHeaders(hp)
err := spec.VerifyStreamClose(conn)
if err != nil {
return err
}
conn.WriteHeaders(hp)
return spec.VerifyConnectionError(conn, http2.ErrCodeStreamClosed)
@ -226,11 +216,6 @@ func StreamStates() *spec.ClientTestGroup {
}
conn.WriteHeaders(hp)
err := spec.VerifyStreamClose(conn)
if err != nil {
return err
}
dummyHeaders := spec.DummyRespHeaders(c, 1)
conn.WriteContinuation(req.StreamID, true, conn.EncodeHeaders(dummyHeaders))

Просмотреть файл

@ -32,7 +32,10 @@ func Continuation() *spec.ClientTestGroup {
conn.WriteContinuation(req.StreamID, false, conn.EncodeHeaders(dummyHeaders))
conn.WriteContinuation(req.StreamID, true, conn.EncodeHeaders(dummyHeaders))
return spec.VerifyHeadersFrame(conn, req.StreamID)
data := [8]byte{}
conn.WritePing(false, data)
return spec.VerifyPingFrameWithAck(conn, data)
},
})

Просмотреть файл

@ -81,6 +81,7 @@ func Headers() *spec.ClientTestGroup {
// HEADERS frame:
// frame length: 16, pad length: 17
var flags http2.Flags
flags |= http2.FlagHeadersPadded
payload := append([]byte("\x11"), conn.EncodeHeaders(headers)...)
conn.WriteRawFrame(http2.FrameHeaders, flags, req.StreamID, payload)

Просмотреть файл

@ -12,58 +12,6 @@ import (
func TheFlowControlWindow() *spec.ClientTestGroup {
tg := NewTestGroup("6.9.1", "The Flow-Control Window")
// The sender MUST NOT send a flow-controlled frame with a length
// that exceeds the space available in either of the flow-control
// windows advertised by the receiver.
tg.AddTestCase(&spec.ClientTestCase{
Desc: "Sends SETTINGS frame to set the initial window size to 1 and sends HEADERS frame",
Requirement: "The endpoint MUST NOT send a flow-controlled frame with a length that exceeds the space available.",
Run: func(c *config.ClientSpecConfig, conn *spec.Conn, req *spec.Request) error {
settings := []http2.Setting{
http2.Setting{
ID: http2.SettingInitialWindowSize,
Val: 1,
},
}
conn.WriteSettings(settings...)
err := spec.VerifySettingsFrameWithAck(conn)
if err != nil {
return err
}
headers := spec.CommonRespHeaders(c)
hp := http2.HeadersFrameParam{
StreamID: req.StreamID,
EndStream: true,
EndHeaders: true,
BlockFragment: conn.EncodeHeaders(headers),
}
conn.WriteHeaders(hp)
actual, passed := conn.WaitEventByType(spec.EventDataFrame)
switch event := actual.(type) {
case spec.DataFrameEvent:
passed = (event.Header().Length == 1)
default:
passed = false
}
if !passed {
expected := []string{
fmt.Sprintf("DATA Frame (length:1, flags:0x00, stream_id:%d)", req.StreamID),
}
return &spec.TestError{
Expected: expected,
Actual: actual.String(),
}
}
return nil
},
})
// A sender MUST NOT allow a flow-control window to exceed 2^31-1
// octets. If a sender receives a WINDOW_UPDATE that causes a
// flow-control window to exceed this maximum, it MUST terminate
@ -75,13 +23,6 @@ func TheFlowControlWindow() *spec.ClientTestGroup {
Desc: "Sends multiple WINDOW_UPDATE frames increasing the flow control window to above 2^31-1",
Requirement: "The endpoint MUST sends a GOAWAY frame with a FLOW_CONTROL_ERROR code.",
Run: func(c *config.ClientSpecConfig, conn *spec.Conn, req *spec.Request) error {
var actual spec.Event
err := conn.Handshake()
if err != nil {
return err
}
conn.WriteWindowUpdate(0, 2147483647)
conn.WriteWindowUpdate(0, 2147483647)