Documentation
¶
Overview ¶
Package voicetest replays a voice gateway text session recorded from the real gateway.
testdata/text_session.json holds the recording. voicegateway/voicertc's TestServeTextSessionTrace drives the production text session with its client messages and fails when the gateway replies differ. Regenerate it with:
go test ./voicegateway/voicertc -run TestServeTextSessionTrace -update
The web voice tests replay the file, and the Android voice fixture serves its gateway replies, so client tests cannot assume messages the gateway does not send.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GatewayReplies ¶
func GatewayReplies(kind voicev2.MessageKind) []json.RawMessage
GatewayReplies returns the gateway messages recorded after the first client message of kind, up to the next client message. It returns nil when no client message has that kind.
Types ¶
type Sender ¶
type Sender string
Sender identifies which side of a text session sent a recorded message.
type Step ¶
type Step struct {
// From is the side that sent Message.
From Sender `json:"from"`
// Message is the protocol message as sent on the WebSocket.
Message json.RawMessage `json:"message"`
// Kind is Message's kind; TextSession sets it.
Kind voicev2.MessageKind `json:"-"`
}
Step is one recorded text-session message.
func TextSession ¶
func TextSession() []Step
TextSession returns the recorded text session in wire order.