diff -Nru indicator-sound-12.10.2+16.04.20160406/debian/changelog indicator-sound-12.10.2+16.04.20160502.1/debian/changelog --- indicator-sound-12.10.2+16.04.20160406/debian/changelog 2016-05-19 17:28:10.000000000 +0000 +++ indicator-sound-12.10.2+16.04.20160502.1/debian/changelog 2016-05-19 17:28:10.000000000 +0000 @@ -1,3 +1,22 @@ +indicator-sound (12.10.2+16.04.20160502.1-0ubuntu1) xenial; urgency=medium + + [ Xavi Garcia Mena ] + * Re-adding some integration tests for notifications after the fix for + Qt has landed. + + -- Xavi Garcia Mon, 02 May 2016 09:14:15 +0000 + +indicator-sound (12.10.2+16.04.20160418.1-0ubuntu1) xenial; urgency=medium + + [ Xavi Garcia Mena ] + * This branch adds a new signal in volumeWarning to set the warning + level volume after pressing cancel. We are setting the warning level + before pressing cancel, which is alright, but sometimes we have + issues with the value set to the accounts service that steps on the + warning level. (LP: #1570779) + + -- Xavi Garcia Mon, 18 Apr 2016 09:18:16 +0000 + indicator-sound (12.10.2+16.04.20160406-0ubuntu1) xenial; urgency=medium * Support multiple desktop names in $XDG_CURRENT_DESKTOP. (LP: diff -Nru indicator-sound-12.10.2+16.04.20160406/src/service.vala indicator-sound-12.10.2+16.04.20160502.1/src/service.vala --- indicator-sound-12.10.2+16.04.20160406/src/service.vala 2016-04-06 19:05:09.000000000 +0000 +++ indicator-sound-12.10.2+16.04.20160502.1/src/service.vala 2016-05-02 09:14:01.000000000 +0000 @@ -68,6 +68,10 @@ update_notification(); }); + this._volume_warning.cancel_pressed.connect( (cancel_volume) => { + volume_control.set_volume_clamp (cancel_volume, VolumeControl.VolumeReasons.USER_KEYPRESS); + }); + this.accounts_service = accounts; /* If we're on the greeter, don't export */ if (this.accounts_service != null) { diff -Nru indicator-sound-12.10.2+16.04.20160406/src/volume-warning.vala indicator-sound-12.10.2+16.04.20160502.1/src/volume-warning.vala --- indicator-sound-12.10.2+16.04.20160406/src/volume-warning.vala 2016-04-06 19:04:59.000000000 +0000 +++ indicator-sound-12.10.2+16.04.20160502.1/src/volume-warning.vala 2016-05-02 09:14:01.000000000 +0000 @@ -213,8 +213,18 @@ if (response == IndicatorSound.WarnNotification.Response.OK) { approve_high_volume (); sound_system_set_multimedia_volume (_ok_volume); + } else { + this.cancel_pressed (this.volume_to_double(_options.loud_volume)); } _ok_volume = PulseAudio.Volume.INVALID; } + + private static double volume_to_double (PulseAudio.Volume vol) + { + double tmp = (double)(vol - PulseAudio.Volume.MUTED); + return tmp / (double)(PulseAudio.Volume.NORM - PulseAudio.Volume.MUTED); + } + + public signal void cancel_pressed (double cancel_volume); } diff -Nru indicator-sound-12.10.2+16.04.20160406/tests/integration/CMakeLists.txt indicator-sound-12.10.2+16.04.20160502.1/tests/integration/CMakeLists.txt --- indicator-sound-12.10.2+16.04.20160406/tests/integration/CMakeLists.txt 2016-04-06 19:04:59.000000000 +0000 +++ indicator-sound-12.10.2+16.04.20160502.1/tests/integration/CMakeLists.txt 2016-05-02 09:14:12.000000000 +0000 @@ -1,7 +1,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) -include(FindGMock) +find_package(GMock REQUIRED) #pkg_check_modules(GMENUHARNESS REQUIRED libgmenuharness REQUIRED) #include_directories(${GMENUHARNESS_INCLUDE_DIRS}) @@ -129,4 +129,4 @@ sound-indicator-dbus-interfaces ) -#add_subdirectory(utils) \ No newline at end of file +#add_subdirectory(utils) diff -Nru indicator-sound-12.10.2+16.04.20160406/tests/integration/test-indicator.cpp indicator-sound-12.10.2+16.04.20160502.1/tests/integration/test-indicator.cpp --- indicator-sound-12.10.2+16.04.20160406/tests/integration/test-indicator.cpp 2016-04-06 19:04:59.000000000 +0000 +++ indicator-sound-12.10.2+16.04.20160502.1/tests/integration/test-indicator.cpp 2016-05-02 09:14:12.000000000 +0000 @@ -1493,7 +1493,7 @@ ).match()); } -TEST_F(TestIndicator, DISABLED_PhoneNotificationVolume) +TEST_F(TestIndicator, PhoneNotificationVolume) { double INITIAL_VOLUME = 0.0; @@ -1545,18 +1545,16 @@ notificationsSpy.clear(); setActionValue("volume", QVariant::fromValue(0.0)); - WAIT_FOR_SIGNALS(notificationsSpy, 2) + WAIT_FOR_SIGNALS(notificationsSpy, 1) - checkNotificationWithNoArgs("GetCapabilities", notificationsSpy.at(0)); - checkVolumeNotification(0.0, "Speakers", false, notificationsSpy.at(1)); + checkVolumeNotification(0.0, "Speakers", false, notificationsSpy.at(0)); notificationsSpy.clear(); setActionValue("volume", QVariant::fromValue(0.5)); - WAIT_FOR_SIGNALS(notificationsSpy, 2) + WAIT_FOR_SIGNALS(notificationsSpy, 1) - checkNotificationWithNoArgs("GetCapabilities", notificationsSpy.at(0)); - checkVolumeNotification(0.5, "Speakers", false, notificationsSpy.at(1)); + checkVolumeNotification(0.5, "Speakers", false, notificationsSpy.at(0)); } TEST_F(TestIndicator, DISABLED_PhoneNotificationWarningVolume) @@ -1757,7 +1755,7 @@ checkVolumeNotification(1.0, "Headphones", true, notificationsSpy.at(3)); } -TEST_F(TestIndicator, DISABLED_PhoneNotificationWarningVolumeAlertMode) +TEST_F(TestIndicator, PhoneNotificationWarningVolumeAlertMode) { double INITIAL_VOLUME = 0.0; @@ -1784,33 +1782,30 @@ // change volume to 0.0... no warning should be emitted setActionValue("volume", QVariant::fromValue(0.0)); - WAIT_FOR_SIGNALS(notificationsSpy, 5); + WAIT_FOR_SIGNALS(notificationsSpy, 4); // the first time we also have the calls to // GetServerInformation and GetCapabilities checkNotificationWithNoArgs("GetServerInformation", notificationsSpy.at(0)); checkNotificationWithNoArgs("GetCapabilities", notificationsSpy.at(1)); checkVolumeNotification(0.0, "Headphones", false, notificationsSpy.at(2)); - checkNotificationWithNoArgs("GetCapabilities", notificationsSpy.at(3)); - checkVolumeNotification(0.0, "Headphones", false, notificationsSpy.at(4)); + checkVolumeNotification(0.0, "Headphones", false, notificationsSpy.at(3)); notificationsSpy.clear(); // change volume to 0.5... no warning should be emitted setActionValue("volume", QVariant::fromValue(0.5)); - WAIT_FOR_SIGNALS(notificationsSpy, 2); + WAIT_FOR_SIGNALS(notificationsSpy, 1); - checkNotificationWithNoArgs("GetCapabilities", notificationsSpy.at(0)); - checkVolumeNotification(0.5, "Headphones", false, notificationsSpy.at(1)); + checkVolumeNotification(0.5, "Headphones", false, notificationsSpy.at(0)); notificationsSpy.clear(); // change volume to 1.0... no warning should be emitted, we are in alert mode setActionValue("volume", QVariant::fromValue(1.0)); - WAIT_FOR_SIGNALS(notificationsSpy, 2); + WAIT_FOR_SIGNALS(notificationsSpy, 1); - checkNotificationWithNoArgs("GetCapabilities", notificationsSpy.at(0)); - checkVolumeNotification(1.0, "Headphones", false, notificationsSpy.at(1)); + checkVolumeNotification(1.0, "Headphones", false, notificationsSpy.at(0)); notificationsSpy.clear(); }