summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-01-22 12:04:27 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-01-22 17:31:43 +0100
commit3eec709839a7f093bf4face949a30c605fcba20c (patch)
tree37d1ce6ffdd13a84fcf86af3c06a4826343234a2
parented3c76d0faa1bf295b2286c6b638dbdf32fe191c (diff)
downloadtelepathy-mission-control-3eec709839a7f093bf4face949a30c605fcba20c.tar.gz
HandleChannels() -> HandleChannel()
-rw-r--r--src/mcd-client-priv.h8
-rw-r--r--src/mcd-client.c68
-rw-r--r--src/mcd-dispatch-operation.c37
-rw-r--r--src/mcd-dispatcher.c28
-rw-r--r--tests/twisted/account-manager/request-online.py2
-rw-r--r--tests/twisted/account-requests/create-text.py10
-rw-r--r--tests/twisted/crash-recovery/crash-recovery.py5
-rw-r--r--tests/twisted/dispatcher/already-has-channel.py2
-rw-r--r--tests/twisted/dispatcher/approver-fails.py2
-rw-r--r--tests/twisted/dispatcher/bypass-approval.py6
-rw-r--r--tests/twisted/dispatcher/capture-bundle.py4
-rw-r--r--tests/twisted/dispatcher/cdo-claim.py2
-rw-r--r--tests/twisted/dispatcher/create-at-startup.py16
-rw-r--r--tests/twisted/dispatcher/create-delayed-by-mini-plugin.py2
-rw-r--r--tests/twisted/dispatcher/create-handler-fails.py16
-rw-r--r--tests/twisted/dispatcher/create-hints.py16
-rw-r--r--tests/twisted/dispatcher/create-no-preferred-handler.py16
-rw-r--r--tests/twisted/dispatcher/create-rejected-by-mini-plugin.py2
-rw-r--r--tests/twisted/dispatcher/create-text.py24
-rw-r--r--tests/twisted/dispatcher/created-behind-our-back.py2
-rw-r--r--tests/twisted/dispatcher/delay-approvers.py2
-rw-r--r--tests/twisted/dispatcher/delay-then-call-handle-with.py6
-rw-r--r--tests/twisted/dispatcher/delay-then-dont-call-approvers.py2
-rw-r--r--tests/twisted/dispatcher/dispatch-activatable.py4
-rw-r--r--tests/twisted/dispatcher/dispatch-before-connected.py2
-rw-r--r--tests/twisted/dispatcher/dispatch-delayed-by-mini-plugin.py20
-rw-r--r--tests/twisted/dispatcher/dispatch-rejected-by-mini-plugin.py2
-rw-r--r--tests/twisted/dispatcher/dispatch-text.py10
-rw-r--r--tests/twisted/dispatcher/ensure-and-redispatch.py46
-rw-r--r--tests/twisted/dispatcher/ensure-is-approval.py16
-rw-r--r--tests/twisted/dispatcher/ensure-rapidly.py28
-rw-r--r--tests/twisted/dispatcher/exploding-bundles.py4
-rw-r--r--tests/twisted/dispatcher/handle-channels-fails.py10
-rw-r--r--tests/twisted/dispatcher/recover-from-disconnect.py2
-rw-r--r--tests/twisted/dispatcher/redispatch-channels.py18
-rw-r--r--tests/twisted/dispatcher/respawn-activatable-observers.py2
-rw-r--r--tests/twisted/dispatcher/respawn-observers.py2
-rw-r--r--tests/twisted/dispatcher/some-delay-approvers.py2
38 files changed, 199 insertions, 247 deletions
diff --git a/src/mcd-client-priv.h b/src/mcd-client-priv.h
index 069d2a67..8e9bbc78 100644
--- a/src/mcd-client-priv.h
+++ b/src/mcd-client-priv.h
@@ -32,6 +32,8 @@
#include <telepathy-glib/telepathy-glib.h>
#include <telepathy-glib/telepathy-glib-dbus.h>
+#include "mcd-channel.h"
+
G_BEGIN_DECLS
typedef struct _McdClientProxy McdClientProxy;
@@ -112,10 +114,10 @@ G_GNUC_INTERNAL guint _mcd_client_match_filters (
GVariant *channel_properties, const GList *filters,
gboolean assume_requested);
-G_GNUC_INTERNAL void _mcd_client_proxy_handle_channels (McdClientProxy *self,
- gint timeout_ms, const GList *channels,
+G_GNUC_INTERNAL void _mcd_client_proxy_handle_channel (McdClientProxy *self,
+ gint timeout_ms, McdChannel *channel,
gint64 user_action_time, GHashTable *handler_info,
- tp_cli_client_handler_callback_for_handle_channels callback,
+ tp_cli_client_handler_callback_for_handle_channel callback,
gpointer user_data, GDestroyNotify destroy, GObject *weak_object);
G_GNUC_INTERNAL void _mcd_client_recover_observer (McdClientProxy *self,
diff --git a/src/mcd-client.c b/src/mcd-client.c
index d51dc1e7..54db916f 100644
--- a/src/mcd-client.c
+++ b/src/mcd-client.c
@@ -1640,26 +1640,28 @@ borrow_channel_connection_path (McdChannel *channel)
}
void
-_mcd_client_proxy_handle_channels (McdClientProxy *self,
+_mcd_client_proxy_handle_channel (McdClientProxy *self,
gint timeout_ms,
- const GList *channels,
+ McdChannel *channel,
gint64 user_action_time,
GHashTable *handler_info,
- tp_cli_client_handler_callback_for_handle_channels callback,
+ tp_cli_client_handler_callback_for_handle_channel callback,
gpointer user_data,
GDestroyNotify destroy,
GObject *weak_object)
{
- GPtrArray *channel_details;
+ GHashTable *chan_props;
GPtrArray *requests_satisfied;
- const GList *iter;
+ gint64 req_time = 0;
+ GHashTable *requests;
+ gpointer path;
+ GHashTableIter it;
g_return_if_fail (MCD_IS_CLIENT_PROXY (self));
- g_return_if_fail (channels != NULL);
+ g_return_if_fail (MCD_IS_CHANNEL (channel));
- DEBUG ("calling HandleChannels on %s", tp_proxy_get_bus_name (self));
+ DEBUG ("calling HandleChannel on %s", tp_proxy_get_bus_name (self));
- channel_details = _mcd_tp_channel_details_build_from_list (channels);
requests_satisfied = g_ptr_array_new_with_free_func (g_free);
if (handler_info == NULL)
@@ -1671,43 +1673,37 @@ _mcd_client_proxy_handle_channels (McdClientProxy *self,
g_hash_table_ref (handler_info);
}
- for (iter = channels; iter != NULL; iter = iter->next)
+ requests = _mcd_channel_get_satisfied_requests (channel, &req_time);
+
+ g_hash_table_iter_init (&it, requests);
+ while (g_hash_table_iter_next (&it, &path, NULL))
{
- gint64 req_time = 0;
- GHashTable *requests;
- GHashTableIter it;
- gpointer path;
+ g_ptr_array_add (requests_satisfied, g_strdup (path));
+ }
- requests = _mcd_channel_get_satisfied_requests (iter->data,
- &req_time);
+ g_hash_table_unref (requests);
- g_hash_table_iter_init (&it, requests);
- while (g_hash_table_iter_next (&it, &path, NULL))
- {
- g_ptr_array_add (requests_satisfied, g_strdup (path));
- }
-
- g_hash_table_unref (requests);
+ /* Numerical order is correct for all currently supported values:
+ *
+ * (TP_USER_ACTION_TIME_NOT_USER_ACTION == 0) is less than
+ * (normal X11 timestamps, which are 1 to G_MAXUINT32) are less than
+ * (TP_USER_ACTION_TIME_CURRENT_TIME == G_MAXINT64) */
+ if (req_time > user_action_time)
+ user_action_time = req_time;
- /* Numerical order is correct for all currently supported values:
- *
- * (TP_USER_ACTION_TIME_NOT_USER_ACTION == 0) is less than
- * (normal X11 timestamps, which are 1 to G_MAXUINT32) are less than
- * (TP_USER_ACTION_TIME_CURRENT_TIME == G_MAXINT64) */
- if (req_time > user_action_time)
- user_action_time = req_time;
+ _mcd_channel_set_status (channel,
+ MCD_CHANNEL_STATUS_HANDLER_INVOKED);
- _mcd_channel_set_status (iter->data,
- MCD_CHANNEL_STATUS_HANDLER_INVOKED);
- }
+ chan_props = mcd_channel_dup_immutable_properties_asv (channel);
- tp_cli_client_handler_call_handle_channels ((TpClient *) self,
- timeout_ms, borrow_channel_account_path (channels->data),
- borrow_channel_connection_path (channels->data), channel_details,
+ tp_cli_client_handler_call_handle_channel ((TpClient *) self,
+ timeout_ms, borrow_channel_account_path (channel),
+ borrow_channel_connection_path (channel),
+ mcd_channel_get_object_path (channel), chan_props,
requests_satisfied, user_action_time, handler_info,
callback, user_data, destroy, weak_object);
- _mcd_tp_channel_details_free (channel_details);
g_ptr_array_unref (requests_satisfied);
g_hash_table_unref (handler_info);
+ g_hash_table_unref (chan_props);
}
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 5299a5b3..d9a832e7 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -251,7 +251,7 @@ struct _McdDispatchOperationPrivate
gboolean observe_only;
/* If non-NULL, we're in the middle of asking plugins whether we may call
- * HandleChannels, or doing so. This is a client lock. */
+ * HandleChannel, or doing so. This is a client lock. */
McdClientProxy *trying_handler;
/* If TRUE, we've tried all the BypassApproval handlers, which happens
@@ -457,7 +457,7 @@ _mcd_dispatch_operation_check_client_locks (McdDispatchOperation *self)
* with an error */
if (self->priv->trying_handler != NULL)
{
- DEBUG ("waiting for handler_is_suitable or HandleChannels to return");
+ DEBUG ("waiting for handler_is_suitable or HandleChannel to return");
return;
}
@@ -516,7 +516,7 @@ _mcd_dispatch_operation_check_client_locks (McdDispatchOperation *self)
approval = g_queue_peek_head (self->priv->approvals);
- /* if we've been claimed, respond, then do not call HandleChannels */
+ /* if we've been claimed, respond, then do not call HandleChannel */
if (approval != NULL && approval->type == APPROVAL_TYPE_CLAIM)
{
/* this needs to be copied because we don't use it til after we've
@@ -1856,7 +1856,7 @@ _mcd_dispatch_operation_dup_channel (McdDispatchOperation *self)
}
static void
-_mcd_dispatch_operation_handle_channels_cb (TpClient *client,
+_mcd_dispatch_operation_handle_channel_cb (TpClient *client,
const GError *error,
gpointer user_data,
GObject *weak G_GNUC_UNUSED)
@@ -1885,9 +1885,9 @@ _mcd_dispatch_operation_handle_channels_cb (TpClient *client,
* are discovered before their handler filters), or the handler
* is activatable and was not running, the handler filter came
* from a .client file, and the bus daemon activated the handler
- * as a side-effect of HandleChannels (in which case
+ * as a side-effect of HandleChannel (in which case
* NameOwnerChanged should have already been emitted by the time
- * we got a reply to HandleChannels).
+ * we got a reply to HandleChannel).
*
* We recover by whining to stderr and closing the channels, in the
* interests of at least failing visibly.
@@ -2245,11 +2245,11 @@ _mcd_dispatch_operation_run_clients (McdDispatchOperation *self)
static void
mcd_dispatch_operation_handle_channels (McdDispatchOperation *self)
{
- GList *channels = NULL;
GHashTable *handler_info;
GHashTable *request_properties;
g_assert (self->priv->trying_handler != NULL);
+ g_return_if_fail (self->priv->channel != NULL);
if (self->priv->handler_unsuitable != NULL)
{
@@ -2260,7 +2260,7 @@ mcd_dispatch_operation_handle_channels (McdDispatchOperation *self)
* handler_unsuitable */
self->priv->handler_unsuitable = NULL;
- _mcd_dispatch_operation_handle_channels_cb (
+ _mcd_dispatch_operation_handle_channel_cb (
(TpClient *) self->priv->trying_handler,
tmp, self, NULL);
g_error_free (tmp);
@@ -2268,31 +2268,20 @@ mcd_dispatch_operation_handle_channels (McdDispatchOperation *self)
return;
}
- /* FIXME: it shouldn't be possible to get here without a channel */
- if (self->priv->channel != NULL)
- {
- collect_satisfied_requests (self->priv->channel, NULL,
- &request_properties);
- channels = g_list_prepend (NULL, self->priv->channel);
- }
- else
- {
- request_properties = g_hash_table_new_full (g_str_hash,
- g_str_equal, g_free, (GDestroyNotify) g_hash_table_unref);
- }
+ collect_satisfied_requests (self->priv->channel, NULL,
+ &request_properties);
handler_info = tp_asv_new (NULL, NULL);
tp_asv_take_boxed (handler_info, "request-properties",
TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP, request_properties);
request_properties = NULL;
- _mcd_client_proxy_handle_channels (self->priv->trying_handler,
- -1, channels, self->priv->handle_with_time,
- handler_info, _mcd_dispatch_operation_handle_channels_cb,
+ _mcd_client_proxy_handle_channel (self->priv->trying_handler,
+ -1, self->priv->channel, self->priv->handle_with_time,
+ handler_info, _mcd_dispatch_operation_handle_channel_cb,
g_object_ref (self), g_object_unref, NULL);
g_hash_table_unref (handler_info);
- g_list_free (channels);
}
static void
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 8fecbd55..67ba93a7 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -983,7 +983,7 @@ mcd_dispatcher_finish_reinvocation (McdChannel *request)
}
static void
-reinvoke_handle_channels_cb (TpClient *client,
+reinvoke_handle_channel_cb (TpClient *client,
const GError *error,
gpointer user_data G_GNUC_UNUSED,
GObject *weak_object)
@@ -1021,7 +1021,6 @@ static void
_mcd_dispatcher_reinvoke_handler (McdDispatcher *dispatcher,
McdChannel *request)
{
- GList *request_as_list;
McdClientProxy *handler = NULL;
McdRequest *real_request = _mcd_channel_get_request (request);
TpChannel *tp_channel = mcd_channel_get_tp_channel (request);
@@ -1031,8 +1030,6 @@ _mcd_dispatcher_reinvoke_handler (McdDispatcher *dispatcher,
g_assert (real_request != NULL);
g_assert (tp_channel != NULL);
- request_as_list = g_list_append (NULL, request);
-
request_properties = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, (GDestroyNotify) g_hash_table_unref);
g_hash_table_insert (request_properties,
@@ -1059,15 +1056,14 @@ _mcd_dispatcher_reinvoke_handler (McdDispatcher *dispatcher,
* is completely different, because the channel is already being
* handled perfectly well. */
- _mcd_client_proxy_handle_channels (handler,
- -1, request_as_list,
+ _mcd_client_proxy_handle_channel (handler,
+ -1, request,
0, /* the request's user action time will be used automatically */
handler_info,
- reinvoke_handle_channels_cb, NULL, NULL, (GObject *) request);
+ reinvoke_handle_channel_cb, NULL, NULL, (GObject *) request);
finally:
g_hash_table_unref (handler_info);
- g_list_free (request_as_list);
}
static McdDispatchOperation *
@@ -1827,7 +1823,6 @@ static void
try_delegating (ChannelToDelegate *to_delegate)
{
McdClientProxy *client;
- GList *channels = NULL;
DEBUG ("%s",
mcd_channel_get_object_path (to_delegate->channel));
@@ -1871,14 +1866,11 @@ try_delegating (ChannelToDelegate *to_delegate)
DEBUG ("...trying client %s", _mcd_client_proxy_get_unique_name (
client));
- channels = g_list_prepend (channels, to_delegate->channel);
-
- _mcd_client_proxy_handle_channels (client, -1, channels,
+ _mcd_client_proxy_handle_channel (client, -1, to_delegate->channel,
to_delegate->ctx->user_action_time, NULL, delegate_channels_cb,
to_delegate, NULL, NULL);
g_object_unref (client);
- g_list_free (channels);
}
static void
@@ -2028,7 +2020,7 @@ error:
}
static void
-present_handle_channels_cb (TpClient *client,
+present_handle_channel_cb (TpClient *client,
const GError *error,
gpointer user_data,
GObject *weak_object)
@@ -2066,7 +2058,6 @@ dispatcher_present_channel (
McdChannel *mcd_channel;
GError *error = NULL;
McdClientProxy *client;
- GList *channels = NULL;
chan_account = _mcd_handler_map_get_channel_account (
self->priv->handler_map, channel_path);
@@ -2105,13 +2096,10 @@ dispatcher_present_channel (
goto error;
}
- channels = g_list_append (channels, mcd_channel);
-
- _mcd_client_proxy_handle_channels (client, -1, channels,
- user_action_time, NULL, present_handle_channels_cb,
+ _mcd_client_proxy_handle_channel (client, -1, mcd_channel,
+ user_action_time, NULL, present_handle_channel_cb,
context, NULL, G_OBJECT (mcd_channel));
- g_list_free (channels);
return;
error:
diff --git a/tests/twisted/account-manager/request-online.py b/tests/twisted/account-manager/request-online.py
index e296b0ec..6dd7fd3d 100644
--- a/tests/twisted/account-manager/request-online.py
+++ b/tests/twisted/account-manager/request-online.py
@@ -140,7 +140,7 @@ def test(q, bus, mc):
chan = SimulatedChannel(conn, new_channel)
chan.announce()
- e = q.expect('dbus-method-call', method='HandleChannels')
+ e = q.expect('dbus-method-call', method='HandleChannel')
q.dbus_return(e.message, signature='')
# Put the account offline
diff --git a/tests/twisted/account-requests/create-text.py b/tests/twisted/account-requests/create-text.py
index 93c4f1e8..3ef1a486 100644
--- a/tests/twisted/account-requests/create-text.py
+++ b/tests/twisted/account-requests/create-text.py
@@ -151,15 +151,13 @@ def test_channel_creation(q, bus, account, client, conn, ensure):
# Handler is next
e = q.expect('dbus-method-call',
path=client.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == channel.object_path, channels
- assert channels[0][1] == channel_immutable, channels
- assert e.args[3] == [request_path], e.args
+ assert e.args[2] == channel.object_path, channels
+ assert e.args[3] == channel_immutable, channels
+ assert e.args[4] == [request_path], e.args
# Handler accepts the Channels
q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/crash-recovery/crash-recovery.py b/tests/twisted/crash-recovery/crash-recovery.py
index 82de020e..a6963e59 100644
--- a/tests/twisted/crash-recovery/crash-recovery.py
+++ b/tests/twisted/crash-recovery/crash-recovery.py
@@ -118,11 +118,10 @@ def test(q, bus, unused, **kwargs):
# ... and as a handler
e = q.expect('dbus-method-call',
path=client.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert channels[0][0] == unhandled_chan.object_path, channels
+ assert e.args[2] == unhandled_chan.object_path, channels
q.dbus_return(e.message, signature='')
if __name__ == '__main__':
diff --git a/tests/twisted/dispatcher/already-has-channel.py b/tests/twisted/dispatcher/already-has-channel.py
index 6b666e12..367c7241 100644
--- a/tests/twisted/dispatcher/already-has-channel.py
+++ b/tests/twisted/dispatcher/already-has-channel.py
@@ -191,7 +191,7 @@ def test(q, bus, mc):
# Empathy is asked to handle the channels
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy accepts the channels
diff --git a/tests/twisted/dispatcher/approver-fails.py b/tests/twisted/dispatcher/approver-fails.py
index b8705bb7..2fb63045 100644
--- a/tests/twisted/dispatcher/approver-fails.py
+++ b/tests/twisted/dispatcher/approver-fails.py
@@ -135,7 +135,7 @@ def test(q, bus, mc):
# No approver works, so Empathy-the-Handler is asked to handle the channels
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy rejects the channels
diff --git a/tests/twisted/dispatcher/bypass-approval.py b/tests/twisted/dispatcher/bypass-approval.py
index eddb3155..05565373 100644
--- a/tests/twisted/dispatcher/bypass-approval.py
+++ b/tests/twisted/dispatcher/bypass-approval.py
@@ -161,7 +161,7 @@ def expect_and_exercise_approval(q, bus, chan, channel_properties,
# Empathy is asked to handle the channels
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy accepts the channels
@@ -239,7 +239,7 @@ def test(q, bus, mc):
# Kopete's BypassApproval part is asked to handle the channels
e = q.expect('dbus-method-call',
path=bypass.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Kopete accepts the channels
q.dbus_return(e.message, signature='')
@@ -279,7 +279,7 @@ def test(q, bus, mc):
# Kopete's BypassApproval part is asked to handle the channels
e = q.expect('dbus-method-call',
path=bypass.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Kopete's BypassApproval part fails to accept the channels
q.dbus_raise(e.message, 'com.example.Broken', 'No way')
diff --git a/tests/twisted/dispatcher/capture-bundle.py b/tests/twisted/dispatcher/capture-bundle.py
index 44e18e87..542456a8 100644
--- a/tests/twisted/dispatcher/capture-bundle.py
+++ b/tests/twisted/dispatcher/capture-bundle.py
@@ -170,7 +170,7 @@ def test(q, bus, mc):
# Empathy is asked to handle the channels
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy accepts the channels
@@ -274,7 +274,7 @@ def test(q, bus, mc):
# Empathy's BypassApproval part is asked to handle the channels
e = q.expect('dbus-method-call',
path=bypass.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy accepts the channels
q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/dispatcher/cdo-claim.py b/tests/twisted/dispatcher/cdo-claim.py
index 89474f9b..0683acc2 100644
--- a/tests/twisted/dispatcher/cdo-claim.py
+++ b/tests/twisted/dispatcher/cdo-claim.py
@@ -128,7 +128,7 @@ def test(q, bus, mc):
# gnome-shell is asked to re-handle the channel
e = q.expect('dbus-method-call',
path=gs.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/dispatcher/create-at-startup.py b/tests/twisted/dispatcher/create-at-startup.py
index 5e03cab8..72c2198c 100644
--- a/tests/twisted/dispatcher/create-at-startup.py
+++ b/tests/twisted/dispatcher/create-at-startup.py
@@ -222,18 +222,16 @@ def test(q, bus, unused, **kwargs):
# Empathy is asked to handle the channel
e = q.expect('dbus-method-call',
path=client.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == channel.object_path, channels
- assert channels[0][1] == channel_immutable, channels
- assert e.args[3] == [request_path], e.args
- assert e.args[4] == user_action_time
- assert isinstance(e.args[5], dict)
- assert len(e.args) == 6
+ assert e.args[2] == channel.object_path, channels
+ assert e.args[3] == channel_immutable, channels
+ assert e.args[4] == [request_path], e.args
+ assert e.args[5] == user_action_time
+ assert isinstance(e.args[6], dict)
+ assert len(e.args) == 7
if __name__ == '__main__':
exec_test(test, {}, preload_mc=False, use_fake_accounts_service=True,
diff --git a/tests/twisted/dispatcher/create-delayed-by-mini-plugin.py b/tests/twisted/dispatcher/create-delayed-by-mini-plugin.py
index 13367eea..1c91eb88 100644
--- a/tests/twisted/dispatcher/create-delayed-by-mini-plugin.py
+++ b/tests/twisted/dispatcher/create-delayed-by-mini-plugin.py
@@ -107,7 +107,7 @@ def test(q, bus, mc):
EventPattern('dbus-method-call', method='EnsureChannel'),
EventPattern('dbus-method-call', method='ObserveChannels'),
EventPattern('dbus-method-call', method='AddDispatchOperation'),
- EventPattern('dbus-method-call', method='HandleChannels'),
+ EventPattern('dbus-method-call', method='HandleChannel'),
]
q.forbid_events(forbidden)
diff --git a/tests/twisted/dispatcher/create-handler-fails.py b/tests/twisted/dispatcher/create-handler-fails.py
index 9969fffb..cc1eeea2 100644
--- a/tests/twisted/dispatcher/create-handler-fails.py
+++ b/tests/twisted/dispatcher/create-handler-fails.py
@@ -156,18 +156,16 @@ def test_channel_creation(q, bus, account, client, conn, ensure):
# Handler is next
e = q.expect('dbus-method-call',
path=client.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == channel.object_path, channels
- assert channels[0][1] == channel_immutable, channels
- assert e.args[3] == [request_path], e.args
- assert e.args[4] == user_action_time
- assert isinstance(e.args[5], dict)
- assert len(e.args) == 6
+ assert e.args[2] == channel.object_path, channels
+ assert e.args[3] == channel_immutable, channels
+ assert e.args[4] == [request_path], e.args
+ assert e.args[5] == user_action_time
+ assert isinstance(e.args[6], dict)
+ assert len(e.args) == 7
# Handler fails at handling channels
q.dbus_raise(e.message, cs.INVALID_ARGUMENT, 'Parlez vous Freezepop?')
diff --git a/tests/twisted/dispatcher/create-hints.py b/tests/twisted/dispatcher/create-hints.py
index 82a6988c..2e6fb557 100644
--- a/tests/twisted/dispatcher/create-hints.py
+++ b/tests/twisted/dispatcher/create-hints.py
@@ -160,18 +160,16 @@ def test_channel_creation(q, bus, account, client, conn,
# Handler is next
e = q.expect('dbus-method-call',
path=prefer.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == channel.object_path, channels
- assert channels[0][1] == channel_immutable, channels
- assert e.args[3] == [request_path], e.args
- assert e.args[4] == user_action_time
- assert isinstance(e.args[5], dict)
- assert len(e.args) == 6
+ assert e.args[2] == channel.object_path, channels
+ assert e.args[3] == channel_immutable, channels
+ assert e.args[4] == [request_path], e.args
+ assert e.args[5] == user_action_time
+ assert isinstance(e.args[6], dict)
+ assert len(e.args) == 7
# Handler accepts the Channels
q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/dispatcher/create-no-preferred-handler.py b/tests/twisted/dispatcher/create-no-preferred-handler.py
index cfa5cf30..e433a555 100644
--- a/tests/twisted/dispatcher/create-no-preferred-handler.py
+++ b/tests/twisted/dispatcher/create-no-preferred-handler.py
@@ -162,18 +162,16 @@ def test_channel_creation(q, bus, account, client, conn, ensure):
# Handler is next
e = q.expect('dbus-method-call',
path=client.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == channel.object_path, channels
- assert channels[0][1] == channel_immutable, channels
- assert e.args[3] == [request_path], e.args
- assert e.args[4] == user_action_time
- assert isinstance(e.args[5], dict)
- assert len(e.args) == 6
+ assert e.args[2] == channel.object_path, channels
+ assert e.args[3] == channel_immutable, channels
+ assert e.args[4] == [request_path], e.args
+ assert e.args[5] == user_action_time
+ assert isinstance(e.args[6], dict)
+ assert len(e.args) == 7
# Handler accepts the Channels
q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/dispatcher/create-rejected-by-mini-plugin.py b/tests/twisted/dispatcher/create-rejected-by-mini-plugin.py
index 50ecbebd..fb09df45 100644
--- a/tests/twisted/dispatcher/create-rejected-by-mini-plugin.py
+++ b/tests/twisted/dispatcher/create-rejected-by-mini-plugin.py
@@ -41,7 +41,7 @@ def test(q, bus, mc):
EventPattern('dbus-method-call', method='EnsureChannel'),
EventPattern('dbus-method-call', method='ObserveChannels'),
EventPattern('dbus-method-call', method='AddDispatchOperation'),
- EventPattern('dbus-method-call', method='HandleChannels'),
+ EventPattern('dbus-method-call', method='HandleChannel'),
]
q.forbid_events(forbidden)
diff --git a/tests/twisted/dispatcher/create-text.py b/tests/twisted/dispatcher/create-text.py
index 8cf64da8..43001968 100644
--- a/tests/twisted/dispatcher/create-text.py
+++ b/tests/twisted/dispatcher/create-text.py
@@ -177,22 +177,20 @@ def test_channel_creation(q, bus, account, client, conn,
# Handler is next
e = q.expect('dbus-method-call',
path=prefer.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == channel.object_path, channels
- assert channels[0][1] == channel_immutable, channels
- assert e.args[3] == [request_path], e.args
- assert e.args[4] == user_action_time
- assert isinstance(e.args[5], dict)
- assertContains('request-properties', e.args[5])
- assertContains(request_path, e.args[5]['request-properties'])
- assertLength(1, e.args[5]['request-properties'])
- assertEquals(request_props, e.args[5]['request-properties'][request_path])
- assert len(e.args) == 6
+ assert e.args[2] == channel.object_path, channels
+ assert e.args[3] == channel_immutable, channels
+ assert e.args[4] == [request_path], e.args
+ assert e.args[5] == user_action_time
+ assert isinstance(e.args[6], dict)
+ assertContains('request-properties', e.args[6])
+ assertContains(request_path, e.args[6]['request-properties'])
+ assertLength(1, e.args[6]['request-properties'])
+ assertEquals(request_props, e.args[6]['request-properties'][request_path])
+ assert len(e.args) == 7
# Handler accepts the Channels
q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/dispatcher/created-behind-our-back.py b/tests/twisted/dispatcher/created-behind-our-back.py
index d87e69ac..b1e03517 100644
--- a/tests/twisted/dispatcher/created-behind-our-back.py
+++ b/tests/twisted/dispatcher/created-behind-our-back.py
@@ -32,7 +32,7 @@ def test(q, bus, mc):
# Because the channels are handled by another process, we should never be
# asked to approve or handle them.
forbidden = [
- EventPattern('dbus-method-call', method='HandleChannels'),
+ EventPattern('dbus-method-call', method='HandleChannel'),
EventPattern('dbus-method-call', method='AddDispatchOperation'),
]
q.forbid_events(forbidden)
diff --git a/tests/twisted/dispatcher/delay-approvers.py b/tests/twisted/dispatcher/delay-approvers.py
index 2a7295f8..f2ae7b19 100644
--- a/tests/twisted/dispatcher/delay-approvers.py
+++ b/tests/twisted/dispatcher/delay-approvers.py
@@ -121,7 +121,7 @@ def test(q, bus, mc):
# Kopete is asked to handle the channels
k = q.expect('dbus-method-call',
path=kopete.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Kopete accepts the channels
diff --git a/tests/twisted/dispatcher/delay-then-call-handle-with.py b/tests/twisted/dispatcher/delay-then-call-handle-with.py
index 28fdfb3e..4ebd01c1 100644
--- a/tests/twisted/dispatcher/delay-then-call-handle-with.py
+++ b/tests/twisted/dispatcher/delay-then-call-handle-with.py
@@ -103,7 +103,7 @@ def test(q, bus, mc):
event = q.expect('dbus-return', method='Get')
# We can't call this synchronously because MC won't return until
- # HandleChannels returns.
+ # HandleChannel returns.
call_async(q, cdo_iface, 'HandleWith', cs.CLIENT + '.Kopete')
# Finally return from ObserveChannels.
@@ -111,7 +111,7 @@ def test(q, bus, mc):
h = q.expect('dbus-method-call',
path=kopete.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Waste a little time here and there. We can't call sync_dbus
@@ -120,7 +120,7 @@ def test(q, bus, mc):
call_async(q, cd_props, 'Get', cs.CD_IFACE_OP_LIST, 'DispatchOperations')
event = q.expect('dbus-return', method='Get')
- # Return from HandleChannels.
+ # Return from HandleChannel.
q.dbus_return(h.message, bus=bus, signature='')
# MC finally returns from HandleWith.
diff --git a/tests/twisted/dispatcher/delay-then-dont-call-approvers.py b/tests/twisted/dispatcher/delay-then-dont-call-approvers.py
index 25ebd908..27c26363 100644
--- a/tests/twisted/dispatcher/delay-then-dont-call-approvers.py
+++ b/tests/twisted/dispatcher/delay-then-dont-call-approvers.py
@@ -90,7 +90,7 @@ def test(q, bus, mc):
forbidden = [EventPattern('dbus-method-call',
interface=cs.APPROVER, method='AddDispatchOperation'),
EventPattern('dbus-method-call',
- interface=cs.HANDLER, method='HandleChannels')]
+ interface=cs.HANDLER, method='HandleChannel')]
q.forbid_events(forbidden)
o = q.expect('dbus-method-call',
diff --git a/tests/twisted/dispatcher/dispatch-activatable.py b/tests/twisted/dispatcher/dispatch-activatable.py
index 6da442b2..2e2dff03 100644
--- a/tests/twisted/dispatcher/dispatch-activatable.py
+++ b/tests/twisted/dispatcher/dispatch-activatable.py
@@ -115,13 +115,13 @@ def test(q, bus, mc):
e = q.expect('dbus-method-call',
path=abiword.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# AbiWord accepts the channels
q.dbus_return(e.message, signature='')
# FIXME: this isn't currently emitted (part of the same bug as emitting
- # it as soon as HandleChannels is called)
+ # it as soon as HandleChannel is called)
#q.expect('dbus-signal', path=cdo_path, signal='Finished')
#q.expect('dbus-signal', path=cs.CD_PATH,
# signal='DispatchOperationFinished', args=[cdo_path])
diff --git a/tests/twisted/dispatcher/dispatch-before-connected.py b/tests/twisted/dispatcher/dispatch-before-connected.py
index 1037ef4c..f9976333 100644
--- a/tests/twisted/dispatcher/dispatch-before-connected.py
+++ b/tests/twisted/dispatcher/dispatch-before-connected.py
@@ -87,7 +87,7 @@ def test(q, bus, mc):
e = q.expect('dbus-method-call',
path=verifier.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
if __name__ == '__main__':
diff --git a/tests/twisted/dispatcher/dispatch-delayed-by-mini-plugin.py b/tests/twisted/dispatcher/dispatch-delayed-by-mini-plugin.py
index 8bc288ad..2db9d912 100644
--- a/tests/twisted/dispatcher/dispatch-delayed-by-mini-plugin.py
+++ b/tests/twisted/dispatcher/dispatch-delayed-by-mini-plugin.py
@@ -107,7 +107,7 @@ def test(q, bus, mc):
# For the beginning of this test, we should never be asked to handle
# a channel.
forbidden = [
- EventPattern('dbus-method-call', method='HandleChannels'),
+ EventPattern('dbus-method-call', method='HandleChannel'),
]
q.forbid_events(forbidden)
@@ -260,7 +260,7 @@ def test(q, bus, mc):
sync_dbus(bus, q, mc)
- # From now on we no longer want to forbid HandleChannels, but we do want
+ # From now on we no longer want to forbid HandleChannel, but we do want
# to forbid AddDispatchOperation
q.unforbid_events(forbidden)
forbidden = [
@@ -316,18 +316,16 @@ def test(q, bus, mc):
e = q.expect('dbus-method-call',
path=kopete.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == chan.object_path, channels
- assert channels[0][1] == chan.immutable, channels
- assert e.args[3] == [request_path], e.args
- assert e.args[4] == user_action_time, (e.args[4], user_action_time)
- assert isinstance(e.args[5], dict)
- assert len(e.args) == 6
+ assert e.args[2] == chan.object_path, channels
+ assert e.args[3] == chan.immutable, channels
+ assert e.args[4] == [request_path], e.args
+ assert e.args[5] == user_action_time, (e.args[4], user_action_time)
+ assert isinstance(e.args[6], dict)
+ assert len(e.args) == 7
# Handler accepts the Channels
q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/dispatcher/dispatch-rejected-by-mini-plugin.py b/tests/twisted/dispatcher/dispatch-rejected-by-mini-plugin.py
index 37a87105..0eb11d01 100644
--- a/tests/twisted/dispatcher/dispatch-rejected-by-mini-plugin.py
+++ b/tests/twisted/dispatcher/dispatch-rejected-by-mini-plugin.py
@@ -45,7 +45,7 @@ def test(q, bus, mc):
# handle a channel.
forbidden = [
EventPattern('dbus-method-call', method='AddDispatchOperation'),
- EventPattern('dbus-method-call', method='HandleChannels'),
+ EventPattern('dbus-method-call', method='HandleChannel'),
]
q.forbid_events(forbidden)
diff --git a/tests/twisted/dispatcher/dispatch-text.py b/tests/twisted/dispatcher/dispatch-text.py
index 689639ca..cc206459 100644
--- a/tests/twisted/dispatcher/dispatch-text.py
+++ b/tests/twisted/dispatcher/dispatch-text.py
@@ -180,7 +180,7 @@ def test(q, bus, mc):
# Empathy is asked to handle the channels
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy accepts the channels
@@ -304,10 +304,10 @@ def test(q, bus, mc):
# Empathy is asked to handle the channels
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
- account_path, conn_path, channels, requests, action_time, info = e.args
+ account_path, conn_path, chan_path, chan_props, requests, action_time, info = e.args
assert action_time == 13
# Empathy accepts the channels
@@ -323,10 +323,10 @@ def test(q, bus, mc):
# Now there are no more active channel dispatch operations
assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == []
- # From now on, it is an error to get HandleChannels (because we're
+ # From now on, it is an error to get HandleChannel (because we're
# testing Claim())
forbidden = [
- EventPattern('dbus-method-call', method='HandleChannels'),
+ EventPattern('dbus-method-call', method='HandleChannel'),
]
q.forbid_events(forbidden)
diff --git a/tests/twisted/dispatcher/ensure-and-redispatch.py b/tests/twisted/dispatcher/ensure-and-redispatch.py
index f69985d2..ddda1ada 100644
--- a/tests/twisted/dispatcher/ensure-and-redispatch.py
+++ b/tests/twisted/dispatcher/ensure-and-redispatch.py
@@ -180,18 +180,16 @@ def test_channel_creation(q, bus, account, client, conn):
# Handler is next
e = q.expect('dbus-method-call',
path=client.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == channel.object_path, channels
- assert channels[0][1] == channel_immutable, channels
- assert e.args[3] == [request_path], e.args
- assert e.args[4] == user_action_time
- assert isinstance(e.args[5], dict)
- assert len(e.args) == 6
+ assert e.args[2] == channel.object_path, channels
+ assert e.args[3] == channel_immutable, channels
+ assert e.args[4] == [request_path], e.args
+ assert e.args[5] == user_action_time
+ assert isinstance(e.args[6], dict)
+ assert len(e.args) == 7
# Handler accepts the Channels
q.dbus_return(e.message, signature='')
@@ -212,7 +210,7 @@ def test_channel_redispatch(q, bus, account, client, conn, channel,
EventPattern('dbus-method-call', method='ObserveChannels'),
# Even though there is a better handler on a different unique
# name, the channels must not be re-dispatched to it.
- EventPattern('dbus-method-call', method='HandleChannels',
+ EventPattern('dbus-method-call', method='HandleChannel',
predicate=lambda e: e.path != client.object_path),
# If the handler rejects the re-handle call, the channel must not
# be closed.
@@ -222,7 +220,7 @@ def test_channel_redispatch(q, bus, account, client, conn, channel,
if client_gone:
# There's nothing to call these methods on any more.
forbidden.append(EventPattern('dbus-method-call',
- method='HandleChannels'))
+ method='HandleChannel'))
forbidden.append(EventPattern('dbus-method-call',
method='AddRequest'))
@@ -288,28 +286,26 @@ def test_channel_redispatch(q, bus, account, client, conn, channel,
channel.object_path, channel.immutable, signature='boa{sv}')
if not client_gone:
- # Handler is re-invoked. This HandleChannels call is only said to
+ # Handler is re-invoked. This HandleChannel call is only said to
# satisfy the new request, because the earlier request has already
# been satisfied.
e = q.expect('dbus-method-call',
path=client.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == channel.object_path, channels
- assert channels[0][1] == channel.immutable, channels
- assert e.args[3] == [request_path], e.args
- assert e.args[4] == user_action_time
- assert isinstance(e.args[5], dict)
- assertContains('request-properties', e.args[5])
- assertContains(request_path, e.args[5]['request-properties'])
- assertLength(1, e.args[5]['request-properties'])
+ assert e.args[2] == channel.object_path, channels
+ assert e.args[3] == channel.immutable, channels
+ assert e.args[4] == [request_path], e.args
+ assert e.args[5] == user_action_time
+ assert isinstance(e.args[6], dict)
+ assertContains('request-properties', e.args[6])
+ assertContains(request_path, e.args[6]['request-properties'])
+ assertLength(1, e.args[6]['request-properties'])
assertEquals(request_props,
- e.args[5]['request-properties'][request_path])
- assert len(e.args) == 6
+ e.args[6]['request-properties'][request_path])
+ assert len(e.args) == 7
if ungrateful_handler:
q.dbus_raise(e.message, cs.INVALID_ARGUMENT,
diff --git a/tests/twisted/dispatcher/ensure-is-approval.py b/tests/twisted/dispatcher/ensure-is-approval.py
index ff929cb0..f6910cc3 100644
--- a/tests/twisted/dispatcher/ensure-is-approval.py
+++ b/tests/twisted/dispatcher/ensure-is-approval.py
@@ -231,18 +231,16 @@ def test(q, bus, mc):
e = q.expect('dbus-method-call',
path=kopete.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == chan.object_path, channels
- assert channels[0][1] == chan.immutable, channels
- assert e.args[3] == [request_path], e.args
- assert e.args[4] == user_action_time, (e.args[4], user_action_time)
- assert isinstance(e.args[5], dict)
- assert len(e.args) == 6
+ assert e.args[2] == chan.object_path, channels
+ assert e.args[3] == chan.immutable, channels
+ assert e.args[4] == [request_path], e.args
+ assert e.args[5] == user_action_time, (e.args[4], user_action_time)
+ assert isinstance(e.args[6], dict)
+ assert len(e.args) == 7
q.dbus_return(e.message, bus=kopete_bus, signature='')
diff --git a/tests/twisted/dispatcher/ensure-rapidly.py b/tests/twisted/dispatcher/ensure-rapidly.py
index ed385f89..46b5eb11 100644
--- a/tests/twisted/dispatcher/ensure-rapidly.py
+++ b/tests/twisted/dispatcher/ensure-rapidly.py
@@ -203,27 +203,25 @@ def test_channel_creation(q, bus, account, client, conn,
# Handler is next
e = q.expect('dbus-method-call',
path=client.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assert e.args[0] == account.object_path, e.args
assert e.args[1] == conn.object_path, e.args
- channels = e.args[2]
- assert len(channels) == 1, channels
- assert channels[0][0] == channel.object_path, channels
- assert channels[0][1] == channel_immutable, channels
- assert sorted(e.args[3]) == sorted([cr1.object_path,
+ assert e.args[2] == channel.object_path, channels
+ assert e.args[3] == channel_immutable, channels
+ assert sorted(e.args[4]) == sorted([cr1.object_path,
cr2.object_path]), e.args
- assert e.args[4] == user_action_time2, (e.args[4], user_action_time2)
- assert isinstance(e.args[5], dict)
- assertContains('request-properties', e.args[5])
- assertContains(cr1.object_path, e.args[5]['request-properties'])
- assertContains(cr2.object_path, e.args[5]['request-properties'])
- assertLength(2, e.args[5]['request-properties'])
+ assert e.args[5] == user_action_time2, (e.args[4], user_action_time2)
+ assert isinstance(e.args[6], dict)
+ assertContains('request-properties', e.args[6])
+ assertContains(cr1.object_path, e.args[6]['request-properties'])
+ assertContains(cr2.object_path, e.args[6]['request-properties'])
+ assertLength(2, e.args[6]['request-properties'])
assertEquals(request_props1,
- e.args[5]['request-properties'][cr1.object_path])
+ e.args[6]['request-properties'][cr1.object_path])
assertEquals(request_props2,
- e.args[5]['request-properties'][cr2.object_path])
- assert len(e.args) == 6
+ e.args[6]['request-properties'][cr2.object_path])
+ assert len(e.args) == 7
# Handler accepts the Channels
q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/dispatcher/exploding-bundles.py b/tests/twisted/dispatcher/exploding-bundles.py
index 27d1727e..40f1a21a 100644
--- a/tests/twisted/dispatcher/exploding-bundles.py
+++ b/tests/twisted/dispatcher/exploding-bundles.py
@@ -239,7 +239,7 @@ def test(q, bus, mc):
# Empathy is asked to handle the channel
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy accepts the channel
@@ -260,7 +260,7 @@ def test(q, bus, mc):
# Empathy is asked to handle the channel
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy accepts the channel
diff --git a/tests/twisted/dispatcher/handle-channels-fails.py b/tests/twisted/dispatcher/handle-channels-fails.py
index 4b3ae22e..858f1973 100644
--- a/tests/twisted/dispatcher/handle-channels-fails.py
+++ b/tests/twisted/dispatcher/handle-channels-fails.py
@@ -150,7 +150,7 @@ def test(q, bus, mc):
# Empathy is asked to handle the channels
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy rejects the channels
@@ -162,7 +162,7 @@ def test(q, bus, mc):
# The channels no longer count as having been approved. Check that MC
# doesn't carry on regardless
- forbidden = [EventPattern('dbus-method-call', method='HandleChannels')]
+ forbidden = [EventPattern('dbus-method-call', method='HandleChannel')]
q.forbid_events(forbidden)
sync_dbus(bus, q, mc)
q.unforbid_events(forbidden)
@@ -174,7 +174,7 @@ def test(q, bus, mc):
# Empathy is asked to handle the channels, again
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy rejects the channels, again
@@ -187,7 +187,7 @@ def test(q, bus, mc):
# OK, OK, is anyone else competent enough to handle them?
# (Also, assert that MC doesn't offer them back to Empathy, knowing that
# it already tried and failed)
- forbidden = [EventPattern('dbus-method-call', method='HandleChannels',
+ forbidden = [EventPattern('dbus-method-call', method='HandleChannel',
path=empathy.object_path)]
q.forbid_events(forbidden)
call_async(q, cdo_iface, 'HandleWith', '')
@@ -195,7 +195,7 @@ def test(q, bus, mc):
# Kopete is asked to handle the channels
k = q.expect('dbus-method-call',
path=kopete.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Kopete rejects the channels too
diff --git a/tests/twisted/dispatcher/recover-from-disconnect.py b/tests/twisted/dispatcher/recover-from-disconnect.py
index 9e0d3c42..20743101 100644
--- a/tests/twisted/dispatcher/recover-from-disconnect.py
+++ b/tests/twisted/dispatcher/recover-from-disconnect.py
@@ -251,7 +251,7 @@ def test_dispatching(q, bus, conn, account, empathy, kopete):
# Empathy is asked to handle the channels
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Empathy accepts the channels
diff --git a/tests/twisted/dispatcher/redispatch-channels.py b/tests/twisted/dispatcher/redispatch-channels.py
index c77e356b..ea732c6a 100644
--- a/tests/twisted/dispatcher/redispatch-channels.py
+++ b/tests/twisted/dispatcher/redispatch-channels.py
@@ -36,7 +36,7 @@ REQUEST = dbus.Dictionary({
}, signature='sv')
def test_ensure(q, bus, account, conn, chan, expected_handler_path):
- """Tests that a client Ensure-ing the channel causes HandleChannels to be
+ """Tests that a client Ensure-ing the channel causes HandleChannel to be
called on the current handler. (Previously, DelegateChannels() and
PresentChannel() both broke this.)"""
cd = ChannelDispatcher(bus)
@@ -54,7 +54,7 @@ def test_ensure(q, bus, account, conn, chan, expected_handler_path):
chan.object_path, chan.immutable, signature='boa{sv}')
e = q.expect('dbus-method-call',
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
assertEquals(expected_handler_path, e.path)
q.dbus_return(e.message, signature='')
@@ -71,7 +71,7 @@ def test_delegate_channel(q, bus, mc, account, conn, chan, empathy, empathy_bus,
# Empathy is asked to handle the channel and accept
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
q.dbus_return(e.message, signature='')
@@ -92,7 +92,7 @@ def test_delegate_channel(q, bus, mc, account, conn, chan, empathy, empathy_bus,
# gnome-shell is asked to handle the channel and accept
e = q.expect('dbus-method-call',
path=gs.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
q.dbus_return(e.message, signature='')
@@ -111,7 +111,7 @@ def test_delegate_channel(q, bus, mc, account, conn, chan, empathy, empathy_bus,
# Empathy is asked to handle the channel but refuses
e = q.expect('dbus-method-call',
path=empathy.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
q.dbus_raise(e.message, cs.NOT_AVAILABLE, "No thanks")
@@ -137,7 +137,7 @@ def test_delegate_channel(q, bus, mc, account, conn, chan, empathy, empathy_bus,
# gnome-shell is asked to re-handle the channel
e = q.expect('dbus-method-call',
path=gs.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
q.dbus_return(e.message, signature='')
@@ -151,7 +151,7 @@ def test_delegate_channel(q, bus, mc, account, conn, chan, empathy, empathy_bus,
# gnome-shell is asked to re-handle the channel
e = q.expect('dbus-method-call',
path=gs.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
q.dbus_return(e.message, signature='')
@@ -242,7 +242,7 @@ def test(q, bus, mc):
e = q.expect('dbus-method-call',
path=gs.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
q.dbus_return(e.message, signature='')
@@ -280,7 +280,7 @@ def test(q, bus, mc):
# gnome-shell handles the channel
e = q.expect('dbus-method-call',
path=gs.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/dispatcher/respawn-activatable-observers.py b/tests/twisted/dispatcher/respawn-activatable-observers.py
index 14727b40..e330beb8 100644
--- a/tests/twisted/dispatcher/respawn-activatable-observers.py
+++ b/tests/twisted/dispatcher/respawn-activatable-observers.py
@@ -163,7 +163,7 @@ def test(q, bus, mc):
# Kopete is asked to handle the channels
k = q.expect('dbus-method-call',
path=kopete.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Kopete accepts the channels
diff --git a/tests/twisted/dispatcher/respawn-observers.py b/tests/twisted/dispatcher/respawn-observers.py
index bf69a794..3cdaaa14 100644
--- a/tests/twisted/dispatcher/respawn-observers.py
+++ b/tests/twisted/dispatcher/respawn-observers.py
@@ -156,7 +156,7 @@ def test(q, bus, mc):
# Kopete is asked to handle the channels
k = q.expect('dbus-method-call',
path=kopete.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Kopete accepts the channels
diff --git a/tests/twisted/dispatcher/some-delay-approvers.py b/tests/twisted/dispatcher/some-delay-approvers.py
index 16e0b7b0..7ad24414 100644
--- a/tests/twisted/dispatcher/some-delay-approvers.py
+++ b/tests/twisted/dispatcher/some-delay-approvers.py
@@ -137,7 +137,7 @@ def test(q, bus, mc):
# Kopete is asked to handle the channels
k = q.expect('dbus-method-call',
path=kopete.object_path,
- interface=cs.HANDLER, method='HandleChannels',
+ interface=cs.HANDLER, method='HandleChannel',
handled=False)
# Kopete accepts the channels