...
1
2
3
4
5
6
7 package quic
8
9 import "testing"
10
11 func TestPing(t *testing.T) {
12 tc := newTestConn(t, clientSide)
13 tc.handshake()
14
15 tc.conn.ping(appDataSpace)
16 tc.wantFrame("connection should send a PING frame",
17 packetType1RTT, debugFramePing{})
18
19 tc.advanceToTimer()
20 tc.wantFrame("on PTO, connection should send another PING frame",
21 packetType1RTT, debugFramePing{})
22
23 tc.wantIdle("after sending PTO probe, no additional frames to send")
24 }
25
26 func TestAck(t *testing.T) {
27 tc := newTestConn(t, serverSide)
28 tc.handshake()
29
30
31 tc.writeFrames(packetType1RTT,
32 debugFramePing{},
33 )
34 tc.writeFrames(packetType1RTT,
35 debugFramePing{},
36 )
37 tc.wantFrame("connection should respond to ack-eliciting packet with an ACK frame",
38 packetType1RTT,
39 debugFrameAck{
40 ranges: []i64range[packetNumber]{{0, 4}},
41 },
42 )
43 }
44
View as plain text