@@ -148,8 +148,8 @@ type runTableTestCase struct {
148148 name string
149149 scheme string // "wss" or "ws"
150150 client func (* testing.T ) * http.Client
151- clientProto websocket.Protocol
152- serverProto websocket.Protocol
151+ clientProto websocket.HTTPProtocol
152+ serverProto websocket.HTTPProtocol
153153 wantProto int // 1 or 2
154154 wantStatus int // Wanted status code (e.g., 200 or 100).
155155 wantErr bool // Want a Dial error.
@@ -228,32 +228,32 @@ var sharedTestCases = []runTableTestCase{
228228 name : "Error TLS ClientHTTP1 RequestHTTP2 AcceptAny" ,
229229 scheme : "wss" ,
230230 client : func (t * testing.T ) * http.Client { return newH1TLSClient () },
231- clientProto : websocket .ProtocolHTTP2 ,
232- serverProto : websocket .ProtocolAcceptAny ,
231+ clientProto : websocket .HTTPProtocol2 ,
232+ serverProto : websocket .HTTPProtocolAny ,
233233 wantErr : true ,
234234 },
235235 {
236236 name : "Error H2C ClientHTTP1 RequestHTTP2 AcceptAny" ,
237237 scheme : "ws" ,
238238 client : func (t * testing.T ) * http.Client { return newH1TLSClient () },
239- clientProto : websocket .ProtocolHTTP2 ,
240- serverProto : websocket .ProtocolAcceptAny ,
239+ clientProto : websocket .HTTPProtocol2 ,
240+ serverProto : websocket .HTTPProtocolAny ,
241241 wantErr : true ,
242242 },
243243 {
244244 name : "Error TLS ClientHTTP2 RequestHTTP2 AcceptHTTP1" ,
245245 scheme : "wss" ,
246246 client : func (t * testing.T ) * http.Client { return newH2TLSClient () },
247- clientProto : websocket .ProtocolHTTP2 ,
248- serverProto : websocket .ProtocolHTTP1 ,
247+ clientProto : websocket .HTTPProtocol2 ,
248+ serverProto : websocket .HTTPProtocol1 ,
249249 wantErr : true ,
250250 },
251251 {
252252 name : "Error TLS ClientHTTP1 RequestHTTP1 AcceptHTTP2" ,
253253 scheme : "wss" ,
254254 client : func (t * testing.T ) * http.Client { return newH1TLSClient () },
255- clientProto : websocket .ProtocolHTTP1 ,
256- serverProto : websocket .ProtocolHTTP2 ,
255+ clientProto : websocket .HTTPProtocol1 ,
256+ serverProto : websocket .HTTPProtocol2 ,
257257 wantErr : true ,
258258 },
259259}
@@ -267,24 +267,24 @@ func TestHTTP2Suite_XCONNECT_Enabled(t *testing.T) {
267267 name : "OK TLS ClientHTTP2 RequestHTTP2 AcceptHTTP2" ,
268268 scheme : "wss" ,
269269 client : func (t * testing.T ) * http.Client { return newH2TLSClient () },
270- clientProto : websocket .ProtocolHTTP2 ,
271- serverProto : websocket .ProtocolHTTP2 ,
270+ clientProto : websocket .HTTPProtocol2 ,
271+ serverProto : websocket .HTTPProtocol2 ,
272272 wantProto : 2 ,
273273 },
274274 {
275275 name : "OK TLS ClientHTTP2 RequestHTTP2 AcceptAny" ,
276276 scheme : "wss" ,
277277 client : func (t * testing.T ) * http.Client { return newH2TLSClient () },
278- clientProto : websocket .ProtocolHTTP2 ,
279- serverProto : websocket .ProtocolAcceptAny ,
278+ clientProto : websocket .HTTPProtocol2 ,
279+ serverProto : websocket .HTTPProtocolAny ,
280280 wantProto : 2 ,
281281 },
282282 {
283283 name : "OK H2C ClientHTTP2 RequestHTTP2 AcceptAny" ,
284284 scheme : "ws" ,
285285 client : func (t * testing.T ) * http.Client { return newH2CClient () },
286- clientProto : websocket .ProtocolHTTP2 ,
287- serverProto : websocket .ProtocolAcceptAny ,
286+ clientProto : websocket .HTTPProtocol2 ,
287+ serverProto : websocket .HTTPProtocolAny ,
288288 wantProto : 2 ,
289289 },
290290 {
@@ -295,8 +295,8 @@ func TestHTTP2Suite_XCONNECT_Enabled(t *testing.T) {
295295 req .Header .Del (":protocol" )
296296 }, nil )
297297 },
298- clientProto : websocket .ProtocolHTTP2 ,
299- serverProto : websocket .ProtocolHTTP2 ,
298+ clientProto : websocket .HTTPProtocol2 ,
299+ serverProto : websocket .HTTPProtocol2 ,
300300 wantErr : true ,
301301 },
302302 {
@@ -311,8 +311,8 @@ func TestHTTP2Suite_XCONNECT_Enabled(t *testing.T) {
311311 req .Method = http .MethodGet
312312 }, nil )
313313 },
314- clientProto : websocket .ProtocolHTTP2 ,
315- serverProto : websocket .ProtocolHTTP2 ,
314+ clientProto : websocket .HTTPProtocol2 ,
315+ serverProto : websocket .HTTPProtocol2 ,
316316 wantErr : true ,
317317 },
318318 {
@@ -326,8 +326,8 @@ func TestHTTP2Suite_XCONNECT_Enabled(t *testing.T) {
326326 _ = resp .Body .Close ()
327327 })
328328 },
329- clientProto : websocket .ProtocolHTTP2 ,
330- serverProto : websocket .ProtocolHTTP2 ,
329+ clientProto : websocket .HTTPProtocol2 ,
330+ serverProto : websocket .HTTPProtocol2 ,
331331 wantErr : true ,
332332 },
333333 }... ))
@@ -342,16 +342,16 @@ func TestHTTP2Suite_XCONNECT_Disabled(t *testing.T) {
342342 name : "Error TLS ClientHTTP2 RequestHTTP2 AcceptAny NoExtendedConnect" ,
343343 scheme : "wss" ,
344344 client : func (t * testing.T ) * http.Client { return newH2TLSClient () },
345- clientProto : websocket .ProtocolHTTP2 ,
346- serverProto : websocket .ProtocolAcceptAny ,
345+ clientProto : websocket .HTTPProtocol2 ,
346+ serverProto : websocket .HTTPProtocolAny ,
347347 wantErr : true ,
348348 },
349349 {
350350 name : "Error H2C ClientHTTP2 RequestHTTP2 AcceptAny NoExtendedConnect" ,
351351 scheme : "ws" ,
352352 client : func (t * testing.T ) * http.Client { return newH2CClient () },
353- clientProto : websocket .ProtocolHTTP2 ,
354- serverProto : websocket .ProtocolAcceptAny ,
353+ clientProto : websocket .HTTPProtocol2 ,
354+ serverProto : websocket .HTTPProtocolAny ,
355355 wantErr : true ,
356356 },
357357 }... ))
0 commit comments