aboutsummaryrefslogtreecommitdiff
path: root/tests/notifications-test.cc
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-24 13:05:10 -0600
committerTed Gould <ted@gould.cx>2015-02-24 13:05:10 -0600
commite5a30aa5678ccf55884691e6c8f35cb439d1a3de (patch)
tree0b191c60ca9a91723e44b5f85ef64296955b1e25 /tests/notifications-test.cc
parentd41efaf10217625c18ce64c257a104301fe03082 (diff)
parenta053aad96cef8673b3be3300825485a511af7d23 (diff)
downloadayatana-indicator-sound-e5a30aa5678ccf55884691e6c8f35cb439d1a3de.tar.gz
ayatana-indicator-sound-e5a30aa5678ccf55884691e6c8f35cb439d1a3de.tar.bz2
ayatana-indicator-sound-e5a30aa5678ccf55884691e6c8f35cb439d1a3de.zip
Merging the max volume branch
Diffstat (limited to 'tests/notifications-test.cc')
-rw-r--r--tests/notifications-test.cc41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/notifications-test.cc b/tests/notifications-test.cc
index 62e8c26..1f7e178 100644
--- a/tests/notifications-test.cc
+++ b/tests/notifications-test.cc
@@ -405,3 +405,44 @@ TEST_F(NotificationsTest, MenuHide) {
notev = notifications->getNotifications();
EXPECT_EQ(1, notev.size());
}
+
+TEST_F(NotificationsTest, ExtendendVolumeNotification) {
+ auto volumeControl = volumeControlMock();
+ auto soundService = standardService(volumeControl, playerListMock());
+
+ /* Set a volume */
+ notifications->clearNotifications();
+ setMockVolume(volumeControl, 0.50);
+ loop(50);
+ auto notev = notifications->getNotifications();
+ ASSERT_EQ(1, notev.size());
+ EXPECT_EQ("indicator-sound", notev[0].app_name);
+ EXPECT_EQ("Volume", notev[0].summary);
+ EXPECT_EQ(0, notev[0].actions.size());
+ EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-canonical-private-synchronous"]);
+ EXPECT_GVARIANT_EQ("@i 50", notev[0].hints["value"]);
+
+ /* Allow an amplified volume */
+ notifications->clearNotifications();
+ indicator_sound_service_set_allow_amplified_volume(soundService.get(), TRUE);
+ loop(50);
+ notev = notifications->getNotifications();
+ ASSERT_EQ(1, notev.size());
+ EXPECT_GVARIANT_EQ("@i 33", notev[0].hints["value"]);
+
+ /* Set to 'over max' */
+ notifications->clearNotifications();
+ setMockVolume(volumeControl, 1.525);
+ loop(50);
+ notev = notifications->getNotifications();
+ ASSERT_EQ(1, notev.size());
+ EXPECT_GVARIANT_EQ("@i 100", notev[0].hints["value"]);
+
+ /* Put back */
+ notifications->clearNotifications();
+ indicator_sound_service_set_allow_amplified_volume(soundService.get(), FALSE);
+ loop(50);
+ notev = notifications->getNotifications();
+ ASSERT_EQ(1, notev.size());
+ EXPECT_GVARIANT_EQ("@i 100", notev[0].hints["value"]);
+}