1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Bridge package to expose http internals to tests in the http_test
10 func (t *Transport) IdleConnKeysForTesting() (keys []string) {
11 keys = make([]string, 0)
14 if t.idleConn == nil {
17 for key := range t.idleConn {
18 keys = append(keys, key)
23 func (t *Transport) IdleConnCountForTesting(cacheKey string) int {
26 if t.idleConn == nil {
29 conns, ok := t.idleConn[cacheKey]
36 func NewTestTimeoutHandler(handler Handler, ch <-chan int64) Handler {
37 f := func() <-chan int64 {
40 return &timeoutHandler{handler, f, ""}