[telepathy-gabble/master] query jingle dialect features not families
Sjoerd Simons
sjoerd.simons at collabora.co.uk
Wed Apr 29 08:32:16 PDT 2009
if we want to know if a specific dialect supports video, ask if it
supports video instead of asking if it's part of a certain dialect family
---
tests/twisted/jingle/hold-av.py | 2 +-
tests/twisted/jingle/initial-audio-video.py | 6 +++---
tests/twisted/jingle/jingletest2.py | 15 +++++++--------
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/tests/twisted/jingle/hold-av.py b/tests/twisted/jingle/hold-av.py
index 150c255..eece649 100644
--- a/tests/twisted/jingle/hold-av.py
+++ b/tests/twisted/jingle/hold-av.py
@@ -27,7 +27,7 @@ def test(jp, q, bus, conn, stream):
call_async(q, media_iface, 'RequestStreams', handle,
[cs.MEDIA_STREAM_TYPE_AUDIO, cs.MEDIA_STREAM_TYPE_VIDEO])
- if jp.is_gtalk():
+ if not jp.can_do_video():
# Video on GTalk? Not so much.
e = q.expect('dbus-error', method='RequestStreams')
# The spec and implemention say this should be NotAvailable, but wjt
diff --git a/tests/twisted/jingle/initial-audio-video.py b/tests/twisted/jingle/initial-audio-video.py
index f7b43e3..ed038c9 100644
--- a/tests/twisted/jingle/initial-audio-video.py
+++ b/tests/twisted/jingle/initial-audio-video.py
@@ -76,8 +76,8 @@ def check_iav(jt, q, conn, bus, stream, remote_handle, initial_audio,
cs.INITIAL_AUDIO: initial_audio,
cs.INITIAL_VIDEO: initial_video,
})
- if initial_video and jt.jp.is_gtalk():
- # You can't do video on ye olde GTalk.
+ if initial_video and not jt.jp.can_do_video():
+ # Some protocols can't do video
event = q.expect('dbus-error', method='CreateChannel')
assertEquals(cs.NOT_CAPABLE, event.error.get_dbus_name())
else:
@@ -138,7 +138,7 @@ def incoming(jp, q, bus, conn, stream):
remote_handle = conn.RequestHandles(cs.HT_CONTACT, [remote_jid])[0]
for a, v in [(True, False), (False, True), (True, True)]:
- if v and jp.is_gtalk():
+ if v and not jp.can_do_video():
continue
jt.incoming_call(audio=a, video=v)
diff --git a/tests/twisted/jingle/jingletest2.py b/tests/twisted/jingle/jingletest2.py
index d73d249..7c6a3ad 100644
--- a/tests/twisted/jingle/jingletest2.py
+++ b/tests/twisted/jingle/jingletest2.py
@@ -110,8 +110,8 @@ class JingleProtocol:
def extract_session_id(self, query):
return query['sid']
- def is_gtalk(self):
- return False
+ def can_do_video(self):
+ return True
def is_modern_jingle(self):
return False
@@ -156,7 +156,6 @@ class GtalkProtocol03(JingleProtocol):
def Description(self, type, children):
return ('description', 'http://www.google.com/session/phone', {}, children)
-
def match_jingle_action(self, q, action):
action = self._action_map(action)
return q is not None and q.name == 'session' and q['type'] == action
@@ -168,8 +167,8 @@ class GtalkProtocol03(JingleProtocol):
def extract_session_id(self, query):
return query['id']
- def is_gtalk(self):
- return True
+ def can_do_video(self):
+ return False
class GtalkProtocol04(JingleProtocol):
features = [ 'http://www.google.com/xmpp/protocol/voice/v1',
@@ -213,8 +212,8 @@ class GtalkProtocol04(JingleProtocol):
def extract_session_id(self, query):
return query['id']
- def is_gtalk(self):
- return True
+ def can_do_video(self):
+ return False
class JingleProtocol015(JingleProtocol):
features = [ 'http://www.google.com/transport/p2p',
@@ -367,7 +366,7 @@ class JingleTest2:
jp.TransportGoogleP2P() ])
)
if video:
- assert not jp.is_gtalk()
+ assert jp.can_do_video()
contents.append(
jp.Content('stream2', 'initiator', 'both', [
jp.Description('video', [
--
1.5.6.5
More information about the telepathy-commits
mailing list