[telepathy-gabble/master] Allow InitialAudio/Video properties

Will Thompson will.thompson at collabora.co.uk
Thu Apr 9 06:20:05 PDT 2009


---
 src/media-factory.c                         |    4 ++++
 tests/twisted/Makefile.am                   |    1 +
 tests/twisted/constants.py                  |    3 +++
 tests/twisted/jingle/initial-audio-video.py |   27 +++++++++++++++++++++++++++
 4 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 tests/twisted/jingle/initial-audio-video.py

diff --git a/src/media-factory.c b/src/media-factory.c
index b2cec6b..45b5308 100644
--- a/src/media-factory.c
+++ b/src/media-factory.c
@@ -34,6 +34,8 @@
 
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
 
+#include "extensions/extensions.h"
+
 #include "caps-channel-manager.h"
 #include "connection.h"
 #include "debug.h"
@@ -401,6 +403,8 @@ static const gchar * const media_channel_fixed_properties[] = {
 static const gchar * const named_channel_allowed_properties[] = {
     TP_IFACE_CHANNEL ".TargetHandle",
     TP_IFACE_CHANNEL ".TargetID",
+    GABBLE_IFACE_CHANNEL_TYPE_STREAMED_MEDIA_FUTURE ".InitialAudio",
+    GABBLE_IFACE_CHANNEL_TYPE_STREAMED_MEDIA_FUTURE ".InitialVideo",
     NULL
 };
 
diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index 66fe66c..0d626a7 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -76,6 +76,7 @@ TWISTED_TESTS = \
 	jingle/google-relay.py \
 	jingle/hold-audio.py \
 	jingle/hold-av.py \
+	jingle/initial-audio-video.py \
 	jingle/stun-server.py \
 	jingle/outgoing-many-streams.py \
 	jingle/outgoing-not-answered.py \
diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py
index 22430f4..52afec9 100644
--- a/tests/twisted/constants.py
+++ b/tests/twisted/constants.py
@@ -43,6 +43,9 @@ INITIATOR_HANDLE = CHANNEL + '.InitiatorHandle'
 INITIATOR_ID = CHANNEL + '.InitiatorID'
 INTERFACES = CHANNEL + '.Interfaces'
 
+INITIAL_AUDIO = CHANNEL_TYPE_STREAMED_MEDIA + '.FUTURE.InitialAudio'
+INITIAL_VIDEO = CHANNEL_TYPE_STREAMED_MEDIA + '.FUTURE.InitialVideo'
+
 CONN = "org.freedesktop.Telepathy.Connection"
 CONN_IFACE_AVATARS = CONN + '.Interface.Avatars'
 CONN_IFACE_CAPS = CONN + '.Interface.Capabilities'
diff --git a/tests/twisted/jingle/initial-audio-video.py b/tests/twisted/jingle/initial-audio-video.py
new file mode 100644
index 0000000..99f8036
--- /dev/null
+++ b/tests/twisted/jingle/initial-audio-video.py
@@ -0,0 +1,27 @@
+"""
+Tests outgoing calls created with InitialAudio and/or InitialVideo.
+"""
+
+from servicetest import assertContains
+
+from jingletest2 import JingleTest2, test_all_dialects
+
+import constants as cs
+
+def test(jp, q, bus, conn, stream):
+    remote_jid = 'flames at cold.mountain/beyond'
+    jt = JingleTest2(jp, conn, q, stream, 'test at localhost', remote_jid)
+    jt.prepare()
+
+    rccs = conn.Properties.Get(cs.CONN_IFACE_REQUESTS, 'RequestableChannelClasses')
+    cclass = ({ cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_STREAMED_MEDIA,
+                cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
+              },
+              [ cs.TARGET_HANDLE, cs.TARGET_ID,
+                cs.INITIAL_AUDIO, cs.INITIAL_VIDEO,
+              ]
+             )
+    assertContains(cclass, rccs)
+
+if __name__ == '__main__':
+    test_all_dialects(test)
-- 
1.5.6.5




More information about the telepathy-commits mailing list