aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-09 23:08:27 -0600
committerTed Gould <ted@gould.cx>2015-02-09 23:08:27 -0600
commit627d27b6bed6f3238f3c87fc8f3c9dcb808d3c27 (patch)
treea0fd2e0516b9046fb61b57322e9245d2558d8b8c /tests
parent2881e3723f86dc21a1deb144803645c9df8e0f0d (diff)
downloadayatana-indicator-sound-627d27b6bed6f3238f3c87fc8f3c9dcb808d3c27.tar.gz
ayatana-indicator-sound-627d27b6bed6f3238f3c87fc8f3c9dcb808d3c27.tar.bz2
ayatana-indicator-sound-627d27b6bed6f3238f3c87fc8f3c9dcb808d3c27.zip
Test to ensure we get a notification
Diffstat (limited to 'tests')
-rw-r--r--tests/notifications-test.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/notifications-test.cc b/tests/notifications-test.cc
index 708061e..3b54a95 100644
--- a/tests/notifications-test.cc
+++ b/tests/notifications-test.cc
@@ -104,4 +104,23 @@ TEST_F(NotificationsTest, BasicObject) {
/* Give some time settle */
loop(50);
+
+ /* Auto free */
+}
+
+TEST_F(NotificationsTest, VolumeChanges) {
+ auto playerList = std::shared_ptr<MediaPlayerList>(MEDIA_PLAYER_LIST(media_player_list_mock_new()), [](MediaPlayerList * list){g_clear_object(&list);});
+ auto volumeControl = std::shared_ptr<VolumeControl>(VOLUME_CONTROL(volume_control_mock_new()), [](VolumeControl * control){g_clear_object(&control);});
+ auto soundService = std::shared_ptr<IndicatorSoundService>(indicator_sound_service_new(playerList.get(), volumeControl.get(), nullptr), [](IndicatorSoundService * service){g_clear_object(&service);});
+
+ loop(50);
+
+ volume_control_set_volume(volumeControl.get(), 50.0);
+
+ loop(50);
+
+ auto notev = notifications->getNotifications();
+
+ ASSERT_EQ(1, notev.size());
+ EXPECT_EQ("indicator-sound", notev[0].app_name);
}