@@ -465,7 +465,7 @@ func setUpWithOptions(t *testing.T, port int, sc *ServerConfig, ht hType, copts
465
465
copts .ChannelzParent = channelzSubChannel (t )
466
466
467
467
connectCtx , cancel := context .WithDeadline (context .Background (), time .Now ().Add (2 * time .Second ))
468
- ct , connErr := NewClientTransport (connectCtx , context .Background (), addr , copts , func (GoAwayReason ) {})
468
+ ct , connErr := NewHTTP2Client (connectCtx , context .Background (), addr , copts , func (GoAwayReason ) {})
469
469
if connErr != nil {
470
470
cancel () // Do not cancel in success path.
471
471
t .Fatalf ("failed to create transport: %v" , connErr )
@@ -496,7 +496,7 @@ func setUpWithNoPingServer(t *testing.T, copts ConnectOptions, connCh chan net.C
496
496
connCh <- conn
497
497
}()
498
498
connectCtx , cancel := context .WithDeadline (context .Background (), time .Now ().Add (2 * time .Second ))
499
- tr , err := NewClientTransport (connectCtx , context .Background (), resolver.Address {Addr : lis .Addr ().String ()}, copts , func (GoAwayReason ) {})
499
+ tr , err := NewHTTP2Client (connectCtx , context .Background (), resolver.Address {Addr : lis .Addr ().String ()}, copts , func (GoAwayReason ) {})
500
500
if err != nil {
501
501
cancel () // Do not cancel in success path.
502
502
// Server clean-up.
@@ -1353,23 +1353,23 @@ func (s) TestClientHonorsConnectContext(t *testing.T) {
1353
1353
1354
1354
parent := channelzSubChannel (t )
1355
1355
copts := ConnectOptions {ChannelzParent : parent }
1356
- _ , err = NewClientTransport (connectCtx , context .Background (), resolver.Address {Addr : lis .Addr ().String ()}, copts , func (GoAwayReason ) {})
1356
+ _ , err = NewHTTP2Client (connectCtx , context .Background (), resolver.Address {Addr : lis .Addr ().String ()}, copts , func (GoAwayReason ) {})
1357
1357
if err == nil {
1358
- t .Fatalf ("NewClientTransport () returned successfully; wanted error" )
1358
+ t .Fatalf ("NewHTTP2Client () returned successfully; wanted error" )
1359
1359
}
1360
- t .Logf ("NewClientTransport () = _, %v" , err )
1360
+ t .Logf ("NewHTTP2Client () = _, %v" , err )
1361
1361
if time .Since (timeBefore ) > 3 * time .Second {
1362
- t .Fatalf ("NewClientTransport returned > 2.9s after context cancellation" )
1362
+ t .Fatalf ("NewHTTP2Client returned > 2.9s after context cancellation" )
1363
1363
}
1364
1364
1365
1365
// Test context deadline.
1366
1366
connectCtx , cancel = context .WithTimeout (context .Background (), 100 * time .Millisecond )
1367
1367
defer cancel ()
1368
- _ , err = NewClientTransport (connectCtx , context .Background (), resolver.Address {Addr : lis .Addr ().String ()}, copts , func (GoAwayReason ) {})
1368
+ _ , err = NewHTTP2Client (connectCtx , context .Background (), resolver.Address {Addr : lis .Addr ().String ()}, copts , func (GoAwayReason ) {})
1369
1369
if err == nil {
1370
- t .Fatalf ("NewClientTransport () returned successfully; wanted error" )
1370
+ t .Fatalf ("NewHTTP2Client () returned successfully; wanted error" )
1371
1371
}
1372
- t .Logf ("NewClientTransport () = _, %v" , err )
1372
+ t .Logf ("NewHTTP2Client () = _, %v" , err )
1373
1373
}
1374
1374
1375
1375
func (s ) TestClientWithMisbehavedServer (t * testing.T ) {
@@ -1445,7 +1445,7 @@ func (s) TestClientWithMisbehavedServer(t *testing.T) {
1445
1445
1446
1446
parent := channelzSubChannel (t )
1447
1447
copts := ConnectOptions {ChannelzParent : parent }
1448
- ct , err := NewClientTransport (connectCtx , context .Background (), resolver.Address {Addr : lis .Addr ().String ()}, copts , func (GoAwayReason ) {})
1448
+ ct , err := NewHTTP2Client (connectCtx , context .Background (), resolver.Address {Addr : lis .Addr ().String ()}, copts , func (GoAwayReason ) {})
1449
1449
if err != nil {
1450
1450
t .Fatalf ("Error while creating client transport: %v" , err )
1451
1451
}
@@ -2436,7 +2436,7 @@ func (ac *attrTransportCreds) Clone() credentials.TransportCredentials {
2436
2436
}
2437
2437
2438
2438
// TestClientHandshakeInfo adds attributes to the resolver.Address passes to
2439
- // NewClientTransport and verifies that these attributes are received by the
2439
+ // NewHTTP2Client and verifies that these attributes are received by the
2440
2440
// transport credential handshaker.
2441
2441
func (s ) TestClientHandshakeInfo (t * testing.T ) {
2442
2442
server := setUpServerOnly (t , 0 , & ServerConfig {}, pingpong )
@@ -2458,9 +2458,9 @@ func (s) TestClientHandshakeInfo(t *testing.T) {
2458
2458
TransportCredentials : creds ,
2459
2459
ChannelzParent : channelzSubChannel (t ),
2460
2460
}
2461
- tr , err := NewClientTransport (ctx , ctx , addr , copts , func (GoAwayReason ) {})
2461
+ tr , err := NewHTTP2Client (ctx , ctx , addr , copts , func (GoAwayReason ) {})
2462
2462
if err != nil {
2463
- t .Fatalf ("NewClientTransport (): %v" , err )
2463
+ t .Fatalf ("NewHTTP2Client (): %v" , err )
2464
2464
}
2465
2465
defer tr .Close (fmt .Errorf ("closed manually by test" ))
2466
2466
@@ -2471,7 +2471,7 @@ func (s) TestClientHandshakeInfo(t *testing.T) {
2471
2471
}
2472
2472
2473
2473
// TestClientHandshakeInfoDialer adds attributes to the resolver.Address passes to
2474
- // NewClientTransport and verifies that these attributes are received by a custom
2474
+ // NewHTTP2Client and verifies that these attributes are received by a custom
2475
2475
// dialer.
2476
2476
func (s ) TestClientHandshakeInfoDialer (t * testing.T ) {
2477
2477
server := setUpServerOnly (t , 0 , & ServerConfig {}, pingpong )
@@ -2499,9 +2499,9 @@ func (s) TestClientHandshakeInfoDialer(t *testing.T) {
2499
2499
Dialer : dialer ,
2500
2500
ChannelzParent : channelzSubChannel (t ),
2501
2501
}
2502
- tr , err := NewClientTransport (ctx , ctx , addr , copts , func (GoAwayReason ) {})
2502
+ tr , err := NewHTTP2Client (ctx , ctx , addr , copts , func (GoAwayReason ) {})
2503
2503
if err != nil {
2504
- t .Fatalf ("NewClientTransport (): %v" , err )
2504
+ t .Fatalf ("NewHTTP2Client (): %v" , err )
2505
2505
}
2506
2506
defer tr .Close (fmt .Errorf ("closed manually by test" ))
2507
2507
@@ -2759,7 +2759,7 @@ func (s) TestClientSendsAGoAwayFrame(t *testing.T) {
2759
2759
}
2760
2760
}()
2761
2761
2762
- ct , err := NewClientTransport (ctx , ctx , resolver.Address {Addr : lis .Addr ().String ()}, ConnectOptions {}, func (GoAwayReason ) {})
2762
+ ct , err := NewHTTP2Client (ctx , ctx , resolver.Address {Addr : lis .Addr ().String ()}, ConnectOptions {}, func (GoAwayReason ) {})
2763
2763
if err != nil {
2764
2764
t .Fatalf ("Error while creating client transport: %v" , err )
2765
2765
}
@@ -2827,7 +2827,7 @@ func (s) TestClientCloseReturnsAfterReaderCompletes(t *testing.T) {
2827
2827
2828
2828
// Create a client transport with a custom dialer that hangs the Read()
2829
2829
// after Close().
2830
- ct , err := NewClientTransport (ctx , context .Background (), addr , copts , func (GoAwayReason ) {})
2830
+ ct , err := NewHTTP2Client (ctx , context .Background (), addr , copts , func (GoAwayReason ) {})
2831
2831
if err != nil {
2832
2832
t .Fatalf ("Failed to create transport: %v" , err )
2833
2833
}
@@ -2914,7 +2914,7 @@ func (s) TestClientCloseReturnsEarlyWhenGoAwayWriteHangs(t *testing.T) {
2914
2914
copts := ConnectOptions {Dialer : dialer }
2915
2915
copts .ChannelzParent = channelzSubChannel (t )
2916
2916
// Create client transport with custom dialer
2917
- ct , connErr := NewClientTransport (connectCtx , context .Background (), addr , copts , func (GoAwayReason ) {})
2917
+ ct , connErr := NewHTTP2Client (connectCtx , context .Background (), addr , copts , func (GoAwayReason ) {})
2918
2918
if connErr != nil {
2919
2919
t .Fatalf ("failed to create transport: %v" , connErr )
2920
2920
}
0 commit comments