Merge lp:~xavi-garcia-mena/indicator-sound/re-add-integration-tests into lp:indicator-sound/15.10

Proposed by Xavi Garcia
Status: Superseded
Proposed branch: lp:~xavi-garcia-mena/indicator-sound/re-add-integration-tests
Merge into: lp:indicator-sound/15.10
Diff against target: 318 lines (+142/-31)
7 files modified
debian/changelog (+77/-0)
debian/control (+11/-0)
src/CMakeLists.txt (+1/-2)
src/service.vala (+5/-2)
src/volume-control-pulse.vala (+41/-22)
src/volume-control.vala (+4/-1)
tests/CMakeLists.txt (+3/-4)
To merge this branch: bzr merge lp:~xavi-garcia-mena/indicator-sound/re-add-integration-tests
Reviewer Review Type Date Requested Status
Xavi Garcia Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+277233@code.launchpad.net

This proposal has been superseded by a proposal from 2015-12-23.

Commit message

This branch re-adds the integration tests using gmenuharness.

Description of the change

This branch re-adds the integration tests using gmenuharness.

I'm approving myself as it was already approved previously as branch:
lp:~xavi-garcia-mena/indicator-sound/remove-warning-message-in-volume-notification

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Xavi Garcia (xavi-garcia-mena) :
review: Approve
510. By Xavi Garcia

Very simple change to make upstart try to respawn the process 30 times (instead of 2).
This is a workaround for the case when dbus session is not ready yet at startup.
Approved by: PS Jenkins bot, Charles Kerr

511. By CI Train Bot Account

Releasing 12.10.2+16.04.20151222-0ubuntu1

512. By Xavi Garcia

Reverted to release 507

513. By Timo Jyrinki

Restore changelog entries for CI Train purposes but note that they should be ignored as they were reverted.

514. By Xavi Garcia

restore OSD notifications

515. By Xavi Garcia

Conflicts resolved with restored branch

516. By Xavi Garcia

removed extra line in debian/changelog

517. By Xavi Garcia

sync debian/changelog with pre-requisite branch

518. By Xavi Garcia

Rolling back to release 516

519. By Xavi Garcia

sync changelog with previous branch

520. By Xavi Garcia

re-added new stuff

521. By Xavi Garcia

remove changed in debian/changelog

522. By Xavi Garcia

[ Xavi Garcia ]
  * Added OSD notifications to show output source when the volume or
    source change (LP: #1382548, LP: #1415480, LP: #1484589)

  * debian/control:
    Added the following build dependencies:
    - cmake-extras (>= 0.4),
    - google-mock (>= 1.6.0+svn437),
    - libqtdbusmock1-dev (>= 0.3),
    - libqtdbustest1-dev,
    - libunity-api-dev,
    - pulseaudio,
    - qt5-default,
    - qtbase5-dev,
    - qtbase5-dev-tools,
    - qtdeclarative5-dev,
    - qtdeclarative5-dev-tools
  * Added gmenuharness library for integration tests support.
    New Files:
    - src/gmenuharness/CMakeLists.txt
    - src/gmenuharness/MatchResult.cpp
    - src/gmenuharness/MatchUtils.cpp
    - src/gmenuharness/MenuItemMatcher.cpp
    - src/gmenuharness/MenuMatcher.cpp
    - include/unity/gmenuharness/MatchResult.h
    - include/unity/gmenuharness/MatchUtils.h
    - include/unity/gmenuharness/MenuItemMatcher.h
    - include/unity/gmenuharness/MenuMatcher.h
  * Added integration tests using gmenuharness
    New Files:
    - tests/dbus-types/CMakeLists.txt
    - tests/dbus-types/com.ubuntu.AccountsService.Sound.xml
    - tests/dbus-types/dbus-types.h
    - tests/dbus-types/org.PulseAudio.Ext.StreamRestore1.xml
    - tests/dbus-types/org.freedesktop.Accounts.xml
    - tests/dbus-types/org.freedesktop.DBus.Properties.xml
    - tests/dbus-types/org.freedesktop.Notifications.xml
    - tests/dbus-types/org.gtk.Actions.xml
    - tests/dbus-types/pulseaudio-volume.cpp
    - tests/dbus-types/pulseaudio-volume.h
    - tests/integration/CMakeLists.txt
    - tests/integration/indicator-sound-test-base.cpp
    - tests/integration/indicator-sound-test-base.h
    - tests/integration/main.cpp
    - tests/integration/test-indicator.cpp
    - tests/integration/touch-stream-restore.table
    - tests/integration/utils/dbus-pulse-volume.cpp
    - tests/integration/utils/dbus-pulse-volume.h
    - tests/integration/utils/get-volume.cpp
    - tests/integration/utils/set-volume.cpp
    - tests/service-mocks/CMakeLists.txt
    - tests/service-mocks/DBusPropertiesNotifier.cpp
    - tests/service-mocks/DBusPropertiesNotifier.h
    - tests/service-mocks/accounts-mock/AccountsDefs.h
    - tests/service-mocks/accounts-mock/AccountsMock.cpp
    - tests/service-mocks/accounts-mock/AccountsMock.h
    - tests/service-mocks/accounts-mock/AccountsServiceSoundMock.cpp
    - tests/service-mocks/accounts-mock/AccountsServiceSoundMock.h
    - tests/service-mocks/accounts-mock/CMakeLists.txt
    - tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml
    - tests/service-mocks/accounts-mock/main.cpp
    - tests/service-mocks/accounts-mock/org.freedesktop.Accounts.Mock.xml
    - tests/service-mocks/media-player-mpris-mock/CMakeLists.txt
    - tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisDefs.h
    - tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisMock.cpp
    - tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisMock.h
    - tests/service-mocks/media-player-mpris-mock/applications/testplayer1.desktop
    - tests/service-mocks/media-player-mpris-mock/main.cpp
    - tests/service-mocks/media-player-mpris-mock/org.mpris.MediaPlayer2.Player.xml
    - tests/service-mocks/media-player-mpris-mock/org.mpris.MediaPlayer2.xml
    - tests/service-mocks/media-player-mpris-mock/player-update.cpp

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-11-03 17:47:10 +0000
3+++ debian/changelog 2015-11-23 11:30:56 +0000
4@@ -9,6 +9,83 @@
5
6 -- Xavi Garcia <xavi.garcia.mena@canonical.com> Tue, 03 Nov 2015 17:47:10 +0000
7
8+indicator-sound (12.10.2+15.10.20151019-0ubuntu3) UNRELEASED; urgency=medium
9+
10+ [ Xavi Garcia ]
11+ * Added OSD notifications to show output source when the volume or
12+ source change (LP: #1382548, LP: #1415480, LP: #1484589)
13+
14+ * debian/control:
15+ Added the following build dependencies:
16+ - cmake-extras (>= 0.4),
17+ - google-mock (>= 1.6.0+svn437),
18+ - libqtdbusmock1-dev (>= 0.3),
19+ - libqtdbustest1-dev,
20+ - libunity-api-dev,
21+ - pulseaudio,
22+ - qt5-default,
23+ - qtbase5-dev,
24+ - qtbase5-dev-tools,
25+ - qtdeclarative5-dev,
26+ - qtdeclarative5-dev-tools
27+ * Added gmenuharness library for integration tests support.
28+ New Files:
29+ - src/gmenuharness/CMakeLists.txt
30+ - src/gmenuharness/MatchResult.cpp
31+ - src/gmenuharness/MatchUtils.cpp
32+ - src/gmenuharness/MenuItemMatcher.cpp
33+ - src/gmenuharness/MenuMatcher.cpp
34+ - include/unity/gmenuharness/MatchResult.h
35+ - include/unity/gmenuharness/MatchUtils.h
36+ - include/unity/gmenuharness/MenuItemMatcher.h
37+ - include/unity/gmenuharness/MenuMatcher.h
38+ * Added integration tests using gmenuharness
39+ New Files:
40+ - tests/dbus-types/CMakeLists.txt
41+ - tests/dbus-types/com.ubuntu.AccountsService.Sound.xml
42+ - tests/dbus-types/dbus-types.h
43+ - tests/dbus-types/org.PulseAudio.Ext.StreamRestore1.xml
44+ - tests/dbus-types/org.freedesktop.Accounts.xml
45+ - tests/dbus-types/org.freedesktop.DBus.Properties.xml
46+ - tests/dbus-types/org.freedesktop.Notifications.xml
47+ - tests/dbus-types/org.gtk.Actions.xml
48+ - tests/dbus-types/pulseaudio-volume.cpp
49+ - tests/dbus-types/pulseaudio-volume.h
50+ - tests/integration/CMakeLists.txt
51+ - tests/integration/indicator-sound-test-base.cpp
52+ - tests/integration/indicator-sound-test-base.h
53+ - tests/integration/main.cpp
54+ - tests/integration/test-indicator.cpp
55+ - tests/integration/touch-stream-restore.table
56+ - tests/integration/utils/dbus-pulse-volume.cpp
57+ - tests/integration/utils/dbus-pulse-volume.h
58+ - tests/integration/utils/get-volume.cpp
59+ - tests/integration/utils/set-volume.cpp
60+ - tests/service-mocks/CMakeLists.txt
61+ - tests/service-mocks/DBusPropertiesNotifier.cpp
62+ - tests/service-mocks/DBusPropertiesNotifier.h
63+ - tests/service-mocks/accounts-mock/AccountsDefs.h
64+ - tests/service-mocks/accounts-mock/AccountsMock.cpp
65+ - tests/service-mocks/accounts-mock/AccountsMock.h
66+ - tests/service-mocks/accounts-mock/AccountsServiceSoundMock.cpp
67+ - tests/service-mocks/accounts-mock/AccountsServiceSoundMock.h
68+ - tests/service-mocks/accounts-mock/CMakeLists.txt
69+ - tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml
70+ - tests/service-mocks/accounts-mock/main.cpp
71+ - tests/service-mocks/accounts-mock/org.freedesktop.Accounts.Mock.xml
72+ - tests/service-mocks/media-player-mpris-mock/CMakeLists.txt
73+ - tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisDefs.h
74+ - tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisMock.cpp
75+ - tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisMock.h
76+ - tests/service-mocks/media-player-mpris-mock/applications/testplayer1.desktop
77+ - tests/service-mocks/media-player-mpris-mock/main.cpp
78+ - tests/service-mocks/media-player-mpris-mock/org.mpris.MediaPlayer2.Player.xml
79+ - tests/service-mocks/media-player-mpris-mock/org.mpris.MediaPlayer2.xml
80+ - tests/service-mocks/media-player-mpris-mock/player-update.cpp
81+
82+
83+ -- Xavi Garcia <xavi.garcia.mena@canonical.com> Wed, 11 Nov 2015 12:40:10 +0100
84+
85 indicator-sound (12.10.2+15.10.20151019-0ubuntu1) wily; urgency=medium
86
87 [ Xavi Garcia Mena ]
88
89=== modified file 'debian/control'
90--- debian/control 2015-11-03 16:21:43 +0000
91+++ debian/control 2015-11-23 11:30:56 +0000
92@@ -5,11 +5,13 @@
93 XSBC-Original-Maintainer: Conor Curran <conor.curran@canonical.com>
94 Build-Depends: debhelper (>= 9.0),
95 cmake,
96+ cmake-extras (>= 0.4),
97 dbus,
98 dbus-test-runner (>> 14.04.0+14.04.20150120.1),
99 dh-translations,
100 gir1.2-accountsservice-1.0,
101 gnome-common,
102+ google-mock (>= 1.6.0+svn437),
103 gsettings-ubuntu-schemas,
104 autotools-dev,
105 valac (>= 0.20),
106@@ -18,13 +20,22 @@
107 libgirepository1.0-dev,
108 libglib2.0-dev (>= 2.22.3),
109 libgtest-dev,
110+ libqtdbusmock1-dev (>= 0.3),
111+ libqtdbustest1-dev,
112+ libunity-api-dev,
113 liburl-dispatcher1-dev,
114 libpulse-dev (>= 1:4.0-0ubuntu21),
115 libpulse-mainloop-glib0 (>= 0.9.18),
116 libnotify-dev,
117 libgee-dev,
118 libxml2-dev,
119+ pulseaudio,
120 python3-dbusmock,
121+ qt5-default,
122+ qtbase5-dev,
123+ qtbase5-dev-tools,
124+ qtdeclarative5-dev,
125+ qtdeclarative5-dev-tools,
126 Standards-Version: 3.9.4
127 Homepage: https://launchpad.net/indicator-sound
128 # If you aren't a member of ~indicator-applet-developers but need to upload
129
130=== modified file 'src/CMakeLists.txt'
131--- src/CMakeLists.txt 2015-11-03 16:21:43 +0000
132+++ src/CMakeLists.txt 2015-11-23 11:30:56 +0000
133@@ -207,5 +207,4 @@
134 RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/indicator-sound/
135 )
136
137-# Disable integration tests
138-# add_subdirectory(gmenuharness)
139+add_subdirectory(gmenuharness)
140
141=== modified file 'src/service.vala'
142--- src/service.vala 2015-10-30 13:24:14 +0000
143+++ src/service.vala 2015-11-23 11:30:56 +0000
144@@ -40,7 +40,7 @@
145 warn_notification.set_hint ("x-canonical-non-shaped-icon", "true");
146 warn_notification.set_hint ("x-canonical-snap-decisions", "true");
147 warn_notification.set_hint ("x-canonical-private-affirmative-tint", "true");
148- warn_notification.closed.connect((n) => { n.clear_actions(); });
149+ warn_notification.closed.connect((n) => { n.clear_actions(); waiting_user_approve_warn=false; });
150 BusWatcher.watch_namespace (GLib.BusType.SESSION,
151 "org.freedesktop.Notifications",
152 () => { debug("Notifications name appeared"); },
153@@ -609,7 +609,10 @@
154 var warn = loud
155 && this.notify_server_supports_actions
156 && !this.volume_control.high_volume_approved;
157-
158+ if (waiting_user_approve_warn && volume_control.below_warning_volume) {
159+ volume_control.set_warning_volume();
160+ close_notification(warn_notification);
161+ }
162 if (warn) {
163 close_notification(info_notification);
164 if (_pre_warn_volume == null) {
165
166=== modified file 'src/volume-control-pulse.vala'
167--- src/volume-control-pulse.vala 2015-10-15 10:08:07 +0000
168+++ src/volume-control-pulse.vala 2015-11-23 11:30:56 +0000
169@@ -140,40 +140,45 @@
170
171 VolumeControl.ActiveOutput ret_output = VolumeControl.ActiveOutput.SPEAKERS;
172 /* Check if the current active port is headset/headphone */
173- /* There is not easy way to check if the port is a headset/headphone besides
174- * checking for the port name. On touch (with the pulseaudio droid element)
175- * the headset/headphone port is called 'output-headset' and 'output-headphone'.
176- * On the desktop this is usually called 'analog-output-headphones' */
177+ /* There is not easy way to check if the port is a headset/headphone besides
178+ * checking for the port name. On touch (with the pulseaudio droid element)
179+ * the headset/headphone port is called 'output-headset' and 'output-headphone'.
180+ * On the desktop this is usually called 'analog-output-headphones' */
181+
182+ // first of all check if we are in call mode
183+ if (sink.active_port != null && sink.active_port.name == "output-speaker+wired_headphone") {
184+ return VolumeControl.ActiveOutput.CALL_MODE;
185+ }
186 // look if it's a headset/headphones
187 if (sink.name == "indicator_sound_test_headphones" ||
188 (sink.active_port != null &&
189 (sink.active_port.name.contains("headset") ||
190- sink.active_port.name.contains("headphone")))) {
191- _active_port_headphone = true;
192- // check if it's a bluetooth device
193- var device_bus = sink.proplist.gets ("device.bus");
194- if (device_bus != null && device_bus == "bluetooth") {
195- ret_output = VolumeControl.ActiveOutput.BLUETOOTH_HEADPHONES;
196- } else if (device_bus != null && device_bus == "usb") {
197- ret_output = VolumeControl.ActiveOutput.USB_HEADPHONES;
198- } else if (device_bus != null && device_bus == "hdmi") {
199- ret_output = VolumeControl.ActiveOutput.HDMI_HEADPHONES;
200- } else {
201- ret_output = VolumeControl.ActiveOutput.HEADPHONES;
202- }
203+ sink.active_port.name.contains("headphone")))) {
204+ _active_port_headphone = true;
205+ // check if it's a bluetooth device
206+ var device_bus = sink.proplist.gets ("device.bus");
207+ if (device_bus != null && device_bus == "bluetooth") {
208+ ret_output = VolumeControl.ActiveOutput.BLUETOOTH_HEADPHONES;
209+ } else if (device_bus != null && device_bus == "usb") {
210+ ret_output = VolumeControl.ActiveOutput.USB_HEADPHONES;
211+ } else if (device_bus != null && device_bus == "hdmi") {
212+ ret_output = VolumeControl.ActiveOutput.HDMI_HEADPHONES;
213+ } else {
214+ ret_output = VolumeControl.ActiveOutput.HEADPHONES;
215+ }
216 } else {
217 // speaker
218 _active_port_headphone = false;
219 var device_bus = sink.proplist.gets ("device.bus");
220- if (device_bus != null && device_bus == "bluetooth") {
221- ret_output = VolumeControl.ActiveOutput.BLUETOOTH_SPEAKER;
222- } else if (device_bus != null && device_bus == "usb") {
223+ if (device_bus != null && device_bus == "bluetooth") {
224+ ret_output = VolumeControl.ActiveOutput.BLUETOOTH_SPEAKER;
225+ } else if (device_bus != null && device_bus == "usb") {
226 ret_output = VolumeControl.ActiveOutput.USB_SPEAKER;
227 } else if (device_bus != null && device_bus == "hdmi") {
228 ret_output = VolumeControl.ActiveOutput.HDMI_SPEAKER;
229 } else {
230 ret_output = VolumeControl.ActiveOutput.SPEAKERS;
231- }
232+ }
233 }
234
235 return ret_output;
236@@ -253,7 +258,9 @@
237
238 // check if the output has changed, if so... emit a signal
239 VolumeControl.ActiveOutput active_output_now = active_output;
240- if (active_output_now != active_output_before) {
241+ if (active_output_now != active_output_before &&
242+ (active_output_now != VolumeControl.ActiveOutput.CALL_MODE &&
243+ active_output_before != VolumeControl.ActiveOutput.CALL_MODE)) {
244 this.active_output_changed (active_output_now);
245 if (active_output_now == VolumeControl.ActiveOutput.SPEAKERS) {
246 _high_volume_approved = false;
247@@ -738,6 +745,10 @@
248 get { return this._high_volume; }
249 private set { this._high_volume = value; }
250 }
251+ public override bool below_warning_volume {
252+ get { return this._volume.volume < this._warning_volume_norms; }
253+ private set { }
254+ }
255 private void init_high_volume() {
256 _settings.changed["warning-volume-enabled"].connect(() => update_high_volume_cache());
257 _settings.changed["warning-volume-decibels"].connect(() => update_high_volume_cache());
258@@ -779,6 +790,14 @@
259 }
260 }
261
262+ public override void set_warning_volume() {
263+ var vol = new VolumeControl.Volume();
264+ vol.volume = _warning_volume_norms;
265+ vol.reason = _volume.reason;
266+ debug("Setting warning level volume from %f down to %f", _volume.volume, vol.volume);
267+ volume = vol;
268+ }
269+
270 /** HIGH VOLUME APPROVED PROPERTY **/
271
272 private bool _high_volume_approved = false;
273
274=== modified file 'src/volume-control.vala'
275--- src/volume-control.vala 2015-10-05 10:10:49 +0000
276+++ src/volume-control.vala 2015-11-23 11:30:56 +0000
277@@ -36,7 +36,8 @@
278 USB_SPEAKER,
279 USB_HEADPHONES,
280 HDMI_SPEAKER,
281- HDMI_HEADPHONES
282+ HDMI_HEADPHONES,
283+ CALL_MODE
284 }
285
286 public class Volume : Object {
287@@ -48,6 +49,7 @@
288 public virtual bool ready { get { return false; } set { } }
289 public virtual bool active_mic { get { return false; } set { } }
290 public virtual bool high_volume { get { return false; } protected set { } }
291+ public virtual bool below_warning_volume { get { return false; } protected set { } }
292 public virtual bool mute { get { return false; } }
293 public virtual bool is_playing { get { return false; } }
294 public virtual VolumeControl.ActiveOutput active_output { get { return VolumeControl.ActiveOutput.SPEAKERS; } }
295@@ -59,6 +61,7 @@
296 public virtual bool high_volume_approved { get { return false; } protected set { } }
297 public virtual void approve_high_volume() { }
298 public virtual void clamp_to_high_volume() { }
299+ public virtual void set_warning_volume() { }
300
301 public abstract void set_mute (bool mute);
302
303
304=== modified file 'tests/CMakeLists.txt'
305--- tests/CMakeLists.txt 2015-11-03 16:21:43 +0000
306+++ tests/CMakeLists.txt 2015-11-23 11:30:56 +0000
307@@ -281,7 +281,6 @@
308 indicator-test
309 )
310
311-# Disable integration tests
312-# add_subdirectory(integration)
313-# add_subdirectory(dbus-types)
314-# add_subdirectory(service-mocks)
315+add_subdirectory(integration)
316+add_subdirectory(dbus-types)
317+add_subdirectory(service-mocks)
318\ No newline at end of file

Subscribers

People subscribed via source and target branches