diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-09-27 16:53:49 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-09-28 11:32:20 +0100 |
commit | 855af5f3bb9f70aaa59768dbeaf50edf68198675 (patch) | |
tree | 96fe67aa8c4dce50726e96d7eda9d1f733e4f531 /tests | |
parent | 68d883e4d7488bd2c692c8bc85e5b8f77950ba01 (diff) |
Account: when reconnecting, use RequestedPresence if possible
Previously, if an account was taken offline due to the internet
connection disappearing, when it was brought back up the
AutomaticPresence would be used, trampling on whatever the user had put
into RequestedPresence.
I guess this was deliberate … but it doesn't seem like very useful
behaviour. If I've explicitly set my presence to ('available', 'you can
talk to me now'), despite my AutomaticPresence being ('busy', 'probably
doing something else'), I don't see why a network connection blip should
cause my lovingly-written presence to be discarded.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/twisted/account-manager/connectivity.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/twisted/account-manager/connectivity.py b/tests/twisted/account-manager/connectivity.py index 913e1809..e102a26e 100644 --- a/tests/twisted/account-manager/connectivity.py +++ b/tests/twisted/account-manager/connectivity.py @@ -20,7 +20,7 @@ import dbus import dbus.service from servicetest import ( - EventPattern, call_async, sync_dbus, + EventPattern, call_async, sync_dbus, assertEquals, ) from mctest import ( exec_test, create_fakecm_account, expect_fakecm_connection, @@ -83,6 +83,14 @@ def test(q, bus, mc): mc.connectivity.go_online() e = q.expect('dbus-method-call', method='RequestConnection') + # In the process, our RequestedPresence should not have been trampled on. + # (Historically, MC would replace it with the AutomaticPresence, but that + # behaviour was unexpected: if the user explicitly set a status or message, + # why should the network connection cutting out and coming back up cause + # that to be lost?) + assertEquals(requested_presence, + account.Properties.Get(cs.ACCOUNT, 'RequestedPresence')) + # But if we get disconnected before RequestConnection returns, MC should # clean up the new connection when it does, rather than trying to sign it # in. |