diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2009-10-21 16:24:12 +1100 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2010-04-08 18:36:45 +1000 |
commit | f05efa5ce5e0fb0b2b2e7c88ce13cf8c9566cd9f (patch) | |
tree | 68db478bd2659f411afe9340f4bdb0462fa279bd | |
parent | af830d85f61f7b3cd6f77956d800a8a46f0020b6 (diff) |
Add a test.js that runs a simple testjs
Doesn't belong in the tools/ directory, I know. Eventually should go somewhere
else.
GJS_DEBUG_OUTPUT=stderr gjs-console -I . test.js
-rw-r--r-- | tools/test.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/test.js b/tools/test.js new file mode 100644 index 00000000..c90d0390 --- /dev/null +++ b/tools/test.js @@ -0,0 +1,37 @@ +log("hello"); + +const DBus = imports.dbus +const Mainloop = imports.mainloop; +const Telepathy = imports.telepathy; + +let bus = DBus.session; + +function ConnectionManager() { + this._init(); +}; + +ConnectionManager.prototype = { + _init: function() { + DBus.session.proxifyObject(this, + 'org.freedesktop.Telepathy.ConnectionManager.gabble', + '/org/freedesktop/Telepathy/ConnectionManager/gabble'); + } +}; +DBus.proxifyPrototype(ConnectionManager.prototype, + Telepathy.ConnectionManager_Iface); + +let cm = new ConnectionManager(); +log(cm); +cm.ListProtocolsRemote(function(r, e) { + log("list protos"); + for (i = 0; i < r.length; i++) + { + log(r[i]); + cm.GetParametersRemote(r[i], function(r,e) { + log("get parameters"); + log(r.toSource()); + }); + } + }); +log("awesome"); +Mainloop.run('test'); |