diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2012-11-26 09:10:39 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2012-11-26 09:57:19 +0000 |
commit | d31e229e8bdc3dad3e7d98bf291c103cb4948c8f (patch) | |
tree | a06dbb528a627fe9c775ff5139a5b3daa2885384 | |
parent | c52894a5facb58465bc6933277e16307f978a767 (diff) |
jingle/payload-types: use jingletest2
-rw-r--r-- | tests/twisted/jingle/payload-types.py | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/tests/twisted/jingle/payload-types.py b/tests/twisted/jingle/payload-types.py index cdc09799c..64a300ff1 100644 --- a/tests/twisted/jingle/payload-types.py +++ b/tests/twisted/jingle/payload-types.py @@ -4,9 +4,9 @@ Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=18918 import dbus -from gabbletest import exec_test, sync_stream +from gabbletest import exec_test from servicetest import wrap_channel, make_channel_proxy -import jingletest +import jingletest2 import constants as cs from config import VOIP_ENABLED @@ -16,23 +16,15 @@ if not VOIP_ENABLED: raise SystemExit(77) def test(q, bus, conn, stream): - jt = jingletest.JingleTest(stream, 'test@localhost', 'foo@bar.com/Foo') + jp = jingletest2.JingleProtocol031() + jt = jingletest2.JingleTest2(jp, conn, q, stream, 'test@localhost', + 'foo@bar.com/Foo') self_handle = conn.GetSelfHandle() - # We need remote end's presence for capabilities - jt.send_remote_presence() + jt.send_presence_and_caps() - # Gabble doesn't trust it, so makes a disco - event = q.expect('stream-iq', query_ns='http://jabber.org/protocol/disco#info', - to='foo@bar.com/Foo') - - jt.send_remote_disco_reply(event.stanza) - - # Force Gabble to process the caps before calling RequestChannel - sync_stream(q, stream) - - handle = conn.RequestHandles(cs.HT_CONTACT, [jt.remote_jid])[0] + handle = conn.RequestHandles(cs.HT_CONTACT, [jt.peer])[0] path = conn.RequestChannel( cs.CHANNEL_TYPE_STREAMED_MEDIA, cs.HT_CONTACT, handle, True) @@ -91,7 +83,8 @@ def test(q, bus, conn, stream): # Test that codec parameters are correctly extracted from <parameter> # children of <payload-type> rather than from attributes of the latter. - jt.incoming_call({'misc': 'other'}) + jt.audio_codecs = [ ('GSM', 3, 8000, {'misc': 'other'}) ] + jt.incoming_call() e = q.expect('dbus-signal', signal='NewSessionHandler') assert e.args[1] == 'rtp' |