diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/indicator-fixture.h | 10 | ||||
-rw-r--r-- | tests/indicator-test.cc | 8 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/indicator-fixture.h b/tests/indicator-fixture.h index 987c7b7..67cacf3 100644 --- a/tests/indicator-fixture.h +++ b/tests/indicator-fixture.h @@ -260,6 +260,16 @@ class IndicatorFixture : public ::testing::Test return expectActionStateIs(name, var); } + bool expectActionStateIs (const std::string& name, double value) { + GVariant * var = g_variant_new_double(value); + return expectActionStateIs(name, var); + } + + bool expectActionStateIs (const std::string& name, float value) { + GVariant * var = g_variant_new_double(value); + return expectActionStateIs(name, var); + } + private: std::shared_ptr<GVariant> getMenuAttributeVal (int location, std::shared_ptr<GMenuModel>& menu, const std::string& attribute, std::shared_ptr<GVariant>& value) { diff --git a/tests/indicator-test.cc b/tests/indicator-test.cc index 7d122ee..47a95f3 100644 --- a/tests/indicator-test.cc +++ b/tests/indicator-test.cc @@ -51,5 +51,11 @@ TEST_F(IndicatorTest, DesktopMenu) { TEST_F(IndicatorTest, SilentActions) { setActions("/com/canonical/indicator/sound"); - expectActionExists("root"); + expectActionExists("scroll"); + + expectActionExists("silent-mode"); + expectActionStateIs("silent-mode", false); + + expectActionExists("mute"); + expectActionStateIs("mute", false); } |