aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-03-09 14:14:38 -0500
committerTed Gould <ted@gould.cx>2015-03-09 14:14:38 -0500
commit414740248af49364c7fce1d0dcf4baa65dca7608 (patch)
tree3ffffb32d200f2d7b96aedf06de55cff498e9c82 /tests
parent0bfd7482c9af44928e884340f4d06e2162933337 (diff)
downloadayatana-indicator-messages-414740248af49364c7fce1d0dcf4baa65dca7608.tar.gz
ayatana-indicator-messages-414740248af49364c7fce1d0dcf4baa65dca7608.tar.bz2
ayatana-indicator-messages-414740248af49364c7fce1d0dcf4baa65dca7608.zip
Add code to activate an action
Diffstat (limited to 'tests')
-rw-r--r--tests/indicator-fixture.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/indicator-fixture.h b/tests/indicator-fixture.h
index d5aa570..a1ca3e2 100644
--- a/tests/indicator-fixture.h
+++ b/tests/indicator-fixture.h
@@ -255,6 +255,21 @@ class IndicatorFixture : public ::testing::Test
agWaitForActions(run->_actions);
}
+ void activateAction (const std::string &name, std::shared_ptr<GVariant> &parameter) {
+ g_action_group_activate_action(run->_actions.get(), name.c_str(), parameter.get());
+ }
+
+ void activateAction (const std::string &name, GVariant * parameter = nullptr) {
+ std::shared_ptr<GVariant> param;
+
+ if (parameter != nullptr)
+ param = std::shared_ptr<GVariant>(g_variant_ref_sink(parameter), [](GVariant * var) {
+ g_variant_unref(var);
+ });
+
+ return activateAction(name, param);
+ }
+
testing::AssertionResult expectActionExists (const gchar * nameStr, const std::string& name) {
bool hasit = g_action_group_has_action(run->_actions.get(), name.c_str());
@@ -526,6 +541,8 @@ class IndicatorFixture : public ::testing::Test
_EVENTUALLY_HELPER(GT);
_EVENTUALLY_HELPER(STREQ);
_EVENTUALLY_HELPER(STRNE);
+
+ #undef _EVENTUALLY_HELPER
};
/* Menu Attrib */