[tor-commits] [snowflake/master] add ReceiveAnswer test to client

serene at torproject.org serene at torproject.org
Fri Mar 4 21:22:52 UTC 2016


commit 26f5caf4047136004e155e70d8794264c58cd9e2
Author: Serene Han <keroserene+git at gmail.com>
Date:   Sat Feb 20 16:11:43 2016 -0800

    add ReceiveAnswer test to client
---
 client/client_test.go | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/client/client_test.go b/client/client_test.go
index 85c2144..14e9393 100644
--- a/client/client_test.go
+++ b/client/client_test.go
@@ -51,6 +51,17 @@ func TestConnect(t *testing.T) {
 				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() {
 				c.reset = make(chan struct{})
 				c.answerChannel = make(chan *webrtc.SessionDescription)





More information about the tor-commits mailing list