aboutsummaryrefslogtreecommitdiff
path: root/tests/accounts-service-mock.h
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-03-04 15:24:10 -0600
committerTed Gould <ted@gould.cx>2014-03-04 15:24:10 -0600
commit6a34818664b50a6b2e9157e6321ed663e9359b1d (patch)
tree7591e6942658f65d8ec7a198a15c3b7c204885a6 /tests/accounts-service-mock.h
parente74821bf9bfbf22d7ddf8099fd879bd33121a353 (diff)
downloadayatana-indicator-sound-6a34818664b50a6b2e9157e6321ed663e9359b1d.tar.gz
ayatana-indicator-sound-6a34818664b50a6b2e9157e6321ed663e9359b1d.tar.bz2
ayatana-indicator-sound-6a34818664b50a6b2e9157e6321ed663e9359b1d.zip
Making a test for checking that we can get in and out of running states
Diffstat (limited to 'tests/accounts-service-mock.h')
-rw-r--r--tests/accounts-service-mock.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/accounts-service-mock.h b/tests/accounts-service-mock.h
index 225d7b5..d4dae7e 100644
--- a/tests/accounts-service-mock.h
+++ b/tests/accounts-service-mock.h
@@ -22,6 +22,8 @@
class AccountsServiceMock
{
DbusTestDbusMock * mock = nullptr;
+ DbusTestDbusMockObject * soundobj = nullptr;
+ DbusTestDbusMockObject * userobj = nullptr;
public:
AccountsServiceMock () {
@@ -45,12 +47,12 @@ class AccountsServiceMock
"UncacheUser", G_VARIANT_TYPE_STRING, NULL,
"", NULL);
- DbusTestDbusMockObject * userobj = dbus_test_dbus_mock_get_object(mock, "/user", "org.freedesktop.Accounts.User", NULL);
+ userobj = dbus_test_dbus_mock_get_object(mock, "/user", "org.freedesktop.Accounts.User", NULL);
dbus_test_dbus_mock_object_add_property(mock, userobj,
"UserName", G_VARIANT_TYPE_STRING,
g_variant_new_string(g_get_user_name()), NULL);
- DbusTestDbusMockObject * soundobj = dbus_test_dbus_mock_get_object(mock, "/user", "com.canonical.indicator.sound.AccountsService", NULL);
+ soundobj = dbus_test_dbus_mock_get_object(mock, "/user", "com.canonical.indicator.sound.AccountsService", NULL);
dbus_test_dbus_mock_object_add_property(mock, soundobj,
"Timestamp", G_VARIANT_TYPE_UINT64,
g_variant_new_uint64(0), NULL);
@@ -81,10 +83,19 @@ class AccountsServiceMock
}
~AccountsServiceMock () {
+ g_debug("Destroying the Accounts Service Mock");
g_clear_object(&mock);
}
operator DbusTestTask* () {
return DBUS_TEST_TASK(mock);
}
+
+ operator DbusTestDbusMock* () {
+ return mock;
+ }
+
+ DbusTestDbusMockObject * get_sound () {
+ return soundobj;
+ }
};