mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 14:11:23 -04:00
add ReceiveAnswer test to client
This commit is contained in:
parent
c3ada1b545
commit
26f5caf404
1 changed files with 11 additions and 0 deletions
|
@ -51,6 +51,17 @@ func TestConnect(t *testing.T) {
|
||||||
So(mock.destination.Bytes(), ShouldResemble, []byte("test"))
|
So(mock.destination.Bytes(), ShouldResemble, []byte("test"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Convey("Receive answer sets remote description", func() {
|
||||||
|
c.answerChannel = make(chan *webrtc.SessionDescription)
|
||||||
|
c.config = webrtc.NewConfiguration()
|
||||||
|
c.PreparePeerConnection()
|
||||||
|
c.ReceiveAnswer()
|
||||||
|
sdp := webrtc.DeserializeSessionDescription("test")
|
||||||
|
c.answerChannel <- sdp
|
||||||
|
So(c.pc.RemoteDescription(), ShouldEqual, sdp)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
Convey("Receive answer fails on nil answer", func() {
|
Convey("Receive answer fails on nil answer", func() {
|
||||||
c.reset = make(chan struct{})
|
c.reset = make(chan struct{})
|
||||||
c.answerChannel = make(chan *webrtc.SessionDescription)
|
c.answerChannel = make(chan *webrtc.SessionDescription)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue