aboutsummaryrefslogtreecommitdiff
path: root/tests/accounts-service-mock.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/accounts-service-mock.h')
-rw-r--r--tests/accounts-service-mock.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/accounts-service-mock.h b/tests/accounts-service-mock.h
index 7a6972d..1d0c1fe 100644
--- a/tests/accounts-service-mock.h
+++ b/tests/accounts-service-mock.h
@@ -25,6 +25,7 @@ class AccountsServiceMock
DbusTestDbusMock * mock = nullptr;
DbusTestDbusMockObject * soundobj = nullptr;
DbusTestDbusMockObject * userobj = nullptr;
+ DbusTestDbusMockObject * syssoundobj = nullptr;
public:
AccountsServiceMock () {
@@ -83,6 +84,11 @@ class AccountsServiceMock
dbus_test_dbus_mock_object_add_property(mock, soundobj,
"ArtUrl", G_VARIANT_TYPE_STRING,
g_variant_new_string(""), NULL);
+
+ syssoundobj = dbus_test_dbus_mock_get_object(mock, "/user", "com.ubuntu.touch.AccountsService.Sound", NULL);
+ dbus_test_dbus_mock_object_add_property(mock, syssoundobj,
+ "SilentMode", G_VARIANT_TYPE_BOOLEAN,
+ g_variant_new_boolean(FALSE), NULL);
}
~AccountsServiceMock () {
@@ -90,6 +96,12 @@ class AccountsServiceMock
g_clear_object(&mock);
}
+ void setSilentMode (bool modeValue) {
+ dbus_test_dbus_mock_object_update_property(mock, syssoundobj,
+ "SilentMode", g_variant_new_boolean(modeValue ? TRUE : FALSE),
+ NULL);
+ }
+
operator std::shared_ptr<DbusTestTask> () {
return std::shared_ptr<DbusTestTask>(
DBUS_TEST_TASK(g_object_ref(mock)),