From 414740248af49364c7fce1d0dcf4baa65dca7608 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 9 Mar 2015 14:14:38 -0500 Subject: Add code to activate an action --- tests/indicator-fixture.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') 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 ¶meter) { + 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 param; + + if (parameter != nullptr) + param = std::shared_ptr(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 */ -- cgit v1.2.3