diff options
Diffstat (limited to 'tests/test-browser-service.py')
-rw-r--r-- | tests/test-browser-service.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/test-browser-service.py b/tests/test-browser-service.py new file mode 100644 index 0000000..8b5eb73 --- /dev/null +++ b/tests/test-browser-service.py @@ -0,0 +1,37 @@ +#!/usr/bin/python2.5 + +import dbus +import dbus.mainloop.glib +import glib + +loop = dbus.mainloop.glib.DBusGMainLoop() +dbus.set_default_main_loop(loop) + +session = dbus.SessionBus() + +proxy = session.get_object('org.freedesktop.Telepathy.Gruschler.BrowserService', + '/org/freedesktop/Telepathy/Gruschler/BrowserService') + + +service = dbus.Interface(proxy, 'org.freedesktop.Telepathy.Gruschler.BrowserService') +path = service.NewChannel('http://www.facebook.com/home.php') + +print service.bus_name, path + +def request_started_cb(*args): + print args + +def request_stopped_cb(*args): + print args + loop.quit() + +def data_available_cb(*args): + print args + +proxy = session.get_object(service.bus_name, path) +proxy.connect_to_signal('RequestStarted', request_started_cb) +proxy.connect_to_signal('RequestStopped', request_stopped_cb) +proxy.connect_to_signal('DataAvailable', data_available_cb) + +loop = glib.MainLoop() +loop.run() |