diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2012-05-02 12:16:13 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2012-05-02 12:16:13 +0100 |
commit | d81cdd5171afb380bdf862b63ddd1858818f0523 (patch) | |
tree | 4590ee6de69476ea133799ab1b887b0d831cca3f /tests | |
parent | ad7122d60c70ba106661a0b0ecd58e36420d46d5 (diff) | |
download | telepathy-haze-d81cdd5171afb380bdf862b63ddd1858818f0523.tar.gz |
caps test: do a simple test for media caps changes
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/twisted/simple-caps.py | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/tests/twisted/simple-caps.py b/tests/twisted/simple-caps.py index 519d0bd..a16f551 100644 --- a/tests/twisted/simple-caps.py +++ b/tests/twisted/simple-caps.py @@ -6,9 +6,11 @@ Make sure ContactCaps works well enough. from twisted.words.xish import domish from servicetest import assertEquals, assertContains, EventPattern -from hazetest import exec_test +from hazetest import exec_test, sync_stream import constants as cs +import config + import ns # assert this list of RCCs is only text @@ -68,7 +70,36 @@ def test_someone_else(q, bus, conn, stream): amy_handle = conn.RequestHandles(cs.HT_CONTACT, ['amy@foo.com'])[0] check_rccs(conn, amy_handle) +def test_media(q, bus, conn, stream): + conn.Connect() + q.expect('dbus-signal', signal='StatusChanged', + args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]) + + sync_stream(q, stream) + + conn.ContactCapabilities.UpdateCapabilities([( + 'im.telepathy1.Client.Foobar', + [{ cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_STREAMED_MEDIA, + cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, + cs.INITIAL_AUDIO: True }, + { cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_STREAMED_MEDIA, + cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, + cs.INITIAL_VIDEO: True }], + [], + )]) + + q.expect('stream-presence') # can't be bothered checking this + + conn.ContactCapabilities.UpdateCapabilities([( + 'im.telepathy1.Client.Foobar', + [], [])]) + + q.expect('stream-presence') # can't be bothered checking this + if __name__ == '__main__': exec_test(test_self_handle) exec_test(test_someone_else) + if config.MEDIA_ENABLED: + exec_test(test_media) + |