add a method to the sendQueue to send probe packets (#4939)

This commit is contained in:
Marten Seemann
2025-01-27 07:54:30 +01:00
committed by GitHub
parent 6f4c002513
commit bb0b645ce9
3 changed files with 58 additions and 1 deletions

View File

@@ -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)
}