aboutsummaryrefslogtreecommitdiff
path: root/tests/notifications-test.cc
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-13 09:56:22 -0600
committerTed Gould <ted@gould.cx>2015-02-13 09:56:22 -0600
commit8159d6abf29c3618d2a3a7d8084f303d5a057594 (patch)
tree10790350f92c6921127ec8cc4e6a2d05c1516ed6 /tests/notifications-test.cc
parent8ab16462724ab3108d1a16e3cea1c66a10ce775b (diff)
downloadayatana-indicator-sound-8159d6abf29c3618d2a3a7d8084f303d5a057594.tar.gz
ayatana-indicator-sound-8159d6abf29c3618d2a3a7d8084f303d5a057594.tar.bz2
ayatana-indicator-sound-8159d6abf29c3618d2a3a7d8084f303d5a057594.zip
Test stream change base cases
Diffstat (limited to 'tests/notifications-test.cc')
-rw-r--r--tests/notifications-test.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/notifications-test.cc b/tests/notifications-test.cc
index 2aff7ae..b43b691 100644
--- a/tests/notifications-test.cc
+++ b/tests/notifications-test.cc
@@ -186,3 +186,31 @@ TEST_F(NotificationsTest, VolumeChanges) {
notev = notifications->getNotifications();
ASSERT_EQ(0, notev.size());
}
+
+TEST_F(NotificationsTest, StreamChanges) {
+ auto volumeControl = volumeControlMock();
+ auto soundService = standardService(volumeControl, playerListMock());
+
+ /* Set a volume */
+ notifications->clearNotifications();
+ volume_control_set_volume(volumeControl.get(), 50.0);
+ loop(50);
+ auto notev = notifications->getNotifications();
+ ASSERT_EQ(1, notev.size());
+
+ /* Change Streams, no volume change */
+ notifications->clearNotifications();
+ volume_control_mock_set_mock_stream(VOLUME_CONTROL_MOCK(volumeControl.get()), "alarm");
+ volume_control_set_volume(volumeControl.get(), 50.0);
+ loop(50);
+ notev = notifications->getNotifications();
+ EXPECT_EQ(0, notev.size());
+
+ /* Change Streams, volume change */
+ notifications->clearNotifications();
+ volume_control_mock_set_mock_stream(VOLUME_CONTROL_MOCK(volumeControl.get()), "alert");
+ volume_control_set_volume(volumeControl.get(), 60.0);
+ loop(50);
+ notev = notifications->getNotifications();
+ EXPECT_EQ(0, notev.size());
+}