[telepathy-gabble/master] Add a test for the codecoffer
Sjoerd Simons
sjoerd.simons at collabora.co.uk
Tue Dec 29 05:34:40 PST 2009
---
tests/twisted/constants.py | 3 +++
tests/twisted/jingle/call-outgoing-basics.py | 24 ++++++++++++++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py
index 72bc5e1..4745cbb 100644
--- a/tests/twisted/constants.py
+++ b/tests/twisted/constants.py
@@ -59,6 +59,9 @@ CALL_CONTENT = 'org.freedesktop.Telepathy.Call.Content.Draft'
CALL_CONTENT_IFACE_MEDIA = \
'org.freedesktop.Telepathy.Call.Content.Interface.Media.Draft'
+CALL_CONTENT_CODECOFFER = \
+ 'org.freedesktop.Telepathy.Call.Content.CodecOffer.Draft'
+
CALL_STREAM = 'org.freedesktop.Telepathy.Call.Stream.Draft'
CALL_STREAM_IFACE_MEDIA = \
'org.freedesktop.Telepathy.Call.Stream.Interface.Media.Draft'
diff --git a/tests/twisted/jingle/call-outgoing-basics.py b/tests/twisted/jingle/call-outgoing-basics.py
index 6a796b2..1b71203 100644
--- a/tests/twisted/jingle/call-outgoing-basics.py
+++ b/tests/twisted/jingle/call-outgoing-basics.py
@@ -90,5 +90,29 @@ def run_test(jp, q, bus, conn, stream):
assertEquals (candidates, local_candidates)
+ session_initiate = q.expect('stream-iq',
+ predicate=jp.action_predicate('session-initiate'))
+
+ jt2.parse_session_initiate(session_initiate.query)
+
+ jt2.accept()
+
+ o = q.expect ('dbus-signal', signal='NewCodecOffer')
+
+ [path, codecs ] = o.args
+ offer = bus.get_object (conn.bus_name, path)
+ ocodecs = offer.Get (cs.CALL_CONTENT_CODECOFFER,
+ "RemoteContactCodecMap", dbus_interface=dbus.PROPERTIES_IFACE)
+
+ assertEquals (codecs, ocodecs)
+
+ codecs = jt2.get_call_audio_codecs_dbus()
+ offer.Accept (codecs, dbus_interface=cs.CALL_CONTENT_CODECOFFER)
+
+ o = q.expect ('dbus-signal', signal='CodecsChanged')
+
+ update, _ = o.args
+ assertEquals ({ self_handle: codecs, remote_handle: codecs} , update)
+
if __name__ == '__main__':
test_all_dialects(run_test)
--
1.5.6.5
More information about the telepathy-commits
mailing list