diff options
author | Ted Gould <ted@gould.cx> | 2014-11-26 08:37:39 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-11-26 08:37:39 -0600 |
commit | 8210778317cd8f8be803f4afa0200bd9cad0f68e (patch) | |
tree | d487224ee282de259d7c96ea983d2b38f81c8b5d /tests/accounts-service-mock.h | |
parent | 008b823ccc75dc3fe23a785a535243d3aea38009 (diff) | |
download | ayatana-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/accounts-service-mock.h')
-rw-r--r-- | tests/accounts-service-mock.h | 12 |
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)), |