forked from quic-go/quic-go
add a method to the sendQueue to send probe packets (#4939)
This commit is contained in:
@@ -2,6 +2,7 @@ package quic
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -170,3 +171,13 @@ func TestSendQueueWriteError(t *testing.T) {
|
||||
t.Fatal("timeout")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSendQueueSendProbe(t *testing.T) {
|
||||
mockCtrl := gomock.NewController(t)
|
||||
c := NewMockSendConn(mockCtrl)
|
||||
q := newSendQueue(c)
|
||||
|
||||
addr := &net.UDPAddr{IP: net.IPv4(42, 42, 42, 42), Port: 42}
|
||||
c.EXPECT().WriteTo([]byte("foobar"), addr)
|
||||
q.SendProbe(getPacketWithContents([]byte("foobar")), addr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user