aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-11-26 08:37:39 -0600
committerTed Gould <ted@gould.cx>2014-11-26 08:37:39 -0600
commit8210778317cd8f8be803f4afa0200bd9cad0f68e (patch)
treed487224ee282de259d7c96ea983d2b38f81c8b5d /tests
parent008b823ccc75dc3fe23a785a535243d3aea38009 (diff)
downloadayatana-indicator-sound-8210778317cd8f8be803f4afa0200bd9cad0f68e.tar.gz
ayatana-indicator-sound-8210778317cd8f8be803f4afa0200bd9cad0f68e.tar.bz2
ayatana-indicator-sound-8210778317cd8f8be803f4afa0200bd9cad0f68e.zip
Add in silent mode support to the AS mock
Diffstat (limited to 'tests')
-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)),