diff options
author | Ted Gould <ted@gould.cx> | 2014-10-28 18:25:34 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-10-28 18:25:34 -0500 |
commit | dc8a919fa15ea03a53e359c60a4f73a3c80be8f4 (patch) | |
tree | ee0b7a20f35ce3f2f759b802eb0b71809581ad36 | |
parent | 642c5d77b0d2fb42a6c9205e50592624542a813f (diff) | |
download | ayatana-indicator-sound-dc8a919fa15ea03a53e359c60a4f73a3c80be8f4.tar.gz ayatana-indicator-sound-dc8a919fa15ea03a53e359c60a4f73a3c80be8f4.tar.bz2 ayatana-indicator-sound-dc8a919fa15ea03a53e359c60a4f73a3c80be8f4.zip |
Building the DBus test integration
-rw-r--r-- | tests/indicator-fixture.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/indicator-fixture.h b/tests/indicator-fixture.h index dfa83a1..4ab3046 100644 --- a/tests/indicator-fixture.h +++ b/tests/indicator-fixture.h @@ -20,6 +20,7 @@ #include <gtest/gtest.h> #include <gio/gio.h> +#include <libdbustest/dbus-test.h> class IndicatorFixture : public ::testing::Test { @@ -27,6 +28,9 @@ class IndicatorFixture : public ::testing::Test std::string _indicatorPath; std::string _indicatorAddress; GMenu * _menu; + DbusTestService * _test_service; + DbusTestTask * _test_indicator; + DbusTestTask * _test_dummy; public: virtual ~IndicatorFixture() = default; @@ -43,14 +47,23 @@ class IndicatorFixture : public ::testing::Test protected: virtual void SetUp() override { + _test_service = dbus_test_service_new(nullptr); + _test_indicator = DBUS_TEST_TASK(dbus_test_process_new(_indicatorPath.c_str())); + dbus_test_service_add_task(_test_service, _test_indicator); + _test_dummy = dbus_test_task_new(); + dbus_test_task_set_wait_for(_test_dummy, _indicatorAddress.c_str()); + dbus_test_service_add_task(_test_service, _test_dummy); + + dbus_test_service_start_tasks(_test_service); } virtual void TearDown() override { - - + g_clear_object(&_test_dummy); + g_clear_object(&_test_indicator); + g_clear_object(&_test_service); } void setMenu (const std::string& path) { |