(t *testing.T)
| 387 | } |
| 388 | |
| 389 | func TestHandshakeTimeoutInContext(t *testing.T) { |
| 390 | s := newServer(t) |
| 391 | defer s.Close() |
| 392 | |
| 393 | d := cstDialer |
| 394 | d.HandshakeTimeout = 0 |
| 395 | d.NetDialContext = func(ctx context.Context, n, a string) (net.Conn, error) { |
| 396 | netDialer := &net.Dialer{} |
| 397 | c, err := netDialer.DialContext(ctx, n, a) |
| 398 | return &requireDeadlineNetConn{c: c, t: t}, err |
| 399 | } |
| 400 | |
| 401 | ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(30*time.Second)) |
| 402 | defer cancel() |
| 403 | ws, _, err := d.DialContext(ctx, s.URL, nil) |
| 404 | if err != nil { |
| 405 | t.Fatal("Dial:", err) |
| 406 | } |
| 407 | ws.Close() |
| 408 | } |
| 409 | |
| 410 | func TestDialBadScheme(t *testing.T) { |
| 411 | s := newServer(t) |
nothing calls this directly
no test coverage detected