aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-07-12 07:42:07 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-07-12 07:42:07 -0500
commita19955f3f81b1a5eb8fc928bc5dcf8a24bb6833f (patch)
tree54b1593439a2ef0e69d30a3b8cb891d865db9d31 /tests
parentc9352cd0a8363e4508d19e66ccf373b2abb2b7d3 (diff)
downloadayatana-indicator-session-a19955f3f81b1a5eb8fc928bc5dcf8a24bb6833f.tar.gz
ayatana-indicator-session-a19955f3f81b1a5eb8fc928bc5dcf8a24bb6833f.tar.bz2
ayatana-indicator-session-a19955f3f81b1a5eb8fc928bc5dcf8a24bb6833f.zip
add the online-accounts action and unit tests for it
Diffstat (limited to 'tests')
-rw-r--r--tests/backend-mock-actions.c7
-rw-r--r--tests/test-service.cc9
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/backend-mock-actions.c b/tests/backend-mock-actions.c
index af4afd9..25a606f 100644
--- a/tests/backend-mock-actions.c
+++ b/tests/backend-mock-actions.c
@@ -141,6 +141,12 @@ my_settings (IndicatorSessionActions * self G_GNUC_UNUSED)
g_settings_set_string (mock_settings, "last-command", "settings");
}
+static void
+my_online_accounts (IndicatorSessionActions * self G_GNUC_UNUSED)
+{
+ g_settings_set_string (mock_settings, "last-command", "online-accounts");
+}
+
static gboolean
my_can_prompt (IndicatorSessionActions * self G_GNUC_UNUSED)
{
@@ -195,6 +201,7 @@ indicator_session_actions_mock_class_init (IndicatorSessionActionsMockClass * kl
actions_class->reboot = my_reboot;
actions_class->power_off = my_power_off;
actions_class->settings = my_settings;
+ actions_class->online_accounts = my_online_accounts;
actions_class->help = my_help;
actions_class->about = my_about;
actions_class->switch_to_screensaver = my_switch_to_screensaver;
diff --git a/tests/test-service.cc b/tests/test-service.cc
index 86f49e6..2027ec0 100644
--- a/tests/test-service.cc
+++ b/tests/test-service.cc
@@ -589,6 +589,15 @@ TEST_F (ServiceTest, OnlineAccountError)
ASSERT_TRUE (find_menu_item_for_action ("indicator.online-accounts", &model, &pos));
g_clear_object (&model);
+ // check that the service has a corresponding action
+ ASSERT_TRUE (g_action_group_has_action (G_ACTION_GROUP(action_group), "online-accounts"));
+ ASSERT_TRUE (g_action_group_get_action_enabled (G_ACTION_GROUP(action_group), "online-accounts"));
+
+ // confirm that activating the action is handled by the service
+ g_action_group_activate_action (G_ACTION_GROUP(action_group), "online-accounts", NULL);
+ wait_for_signal (mock_settings, "changed::last-command");
+ check_last_command_is ("online-accounts");
+
// check that the header's icon and a11y adjusted to the error state
check_header ("", "system-devices-panel-alert", "System (Attention Required)");