From 95fdfc766027896c19062f8b7e6d9589471be4b0 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 12 Feb 2015 15:12:38 -0600 Subject: More notification testings. --- tests/notifications-test.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'tests/notifications-test.cc') diff --git a/tests/notifications-test.cc b/tests/notifications-test.cc index 3da41cd..06eac7a 100644 --- a/tests/notifications-test.cc +++ b/tests/notifications-test.cc @@ -126,14 +126,25 @@ TEST_F(NotificationsTest, VolumeChanges) { auto volumeControl = std::shared_ptr(VOLUME_CONTROL(volume_control_mock_new()), [](VolumeControl * control){g_clear_object(&control);}); auto soundService = std::shared_ptr(indicator_sound_service_new(playerList.get(), volumeControl.get(), nullptr), [](IndicatorSoundService * service){g_clear_object(&service);}); - loop(50); - + /* Set a volume */ + notifications->clearNotifications(); 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); + + /* Set a different volume */ + notifications->clearNotifications(); + volume_control_set_volume(volumeControl.get(), 60.0); + loop(50); + notev = notifications->getNotifications(); + ASSERT_EQ(1, notev.size()); + + /* Set the same volume */ + notifications->clearNotifications(); + volume_control_set_volume(volumeControl.get(), 60.0); + loop(50); + notev = notifications->getNotifications(); + ASSERT_EQ(0, notev.size()); } -- cgit v1.2.3