Merge lp:~pitti/unity8/notify-api-fix into lp:unity8

Proposed by Martin Pitt on 2015-01-06
Status: Merged
Approved by: Michał Sawicz on 2015-01-07
Approved revision: 1524
Merged at revision: 1529
Proposed branch: lp:~pitti/unity8/notify-api-fix
Merge into: lp:unity8
Diff against target: 10 lines (+0/-1)
1 file modified
tests/autopilot/unity8/shell/emulators/create_interactive_notification.py (+0/-1)
To merge this branch: bzr merge lp:~pitti/unity8/notify-api-fix
Reviewer Review Type Date Requested Status
Michał Sawicz 2015-01-06 Approve on 2015-01-07
PS Jenkins bot continuous-integration Approve on 2015-01-06
Mirco Müller 2015-01-07 Pending
Review via email: mp+245643@code.launchpad.net

Commit Message

tests: Fix Notify.Notification.add_action invocation to work also with unpatched libnotify API.

Description of the Change

Fix libnotify add_action invocation for bug 1223401. Please see the commit log
for details.

To post a comment you must log in.
Martin Pitt (pitti) wrote :

Clarification for specifying "None, None": With the patched Ubuntu API, the second "None" will just be ignored (that's the free_func argument) and the callback will get one user_data argument, exactly what it expects:

   def action_callback(notification, action_id, data):

But with the upstream API, action_callback will get a second data argument with the second None, due to how pygobject handles a list of user_data arguments.

With just specifying "None", action_callback will get a single data (None) in both cases. See the bug trail for even more details and python single-liners to illustrate this.

Martin Pitt (pitti) wrote :

The notification tests like

13:45:46.652 INFO testresult:44 - OK: unity8.shell.tests.test_notifications.InteractiveNotificationBase.test_interactive(Native Device)

ran ok.

Michał Sawicz (saviq) wrote :

W dniu 06.01.2015 o 15:43, Martin Pitt pisze:
> The notification tests like
>
> 13:45:46.652 INFO testresult:44 - OK: unity8.shell.tests.test_notifications.InteractiveNotificationBase.test_interactive(Native Device)
>
> ran ok.

Yeah, sorry about that, need to investigate the flakiness.

Have triggered a re-run in the mean time.

Michał Sawicz (saviq) wrote :

Yeah, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/unity8/shell/emulators/create_interactive_notification.py'
2--- tests/autopilot/unity8/shell/emulators/create_interactive_notification.py 2014-02-24 17:43:10 +0000
3+++ tests/autopilot/unity8/shell/emulators/create_interactive_notification.py 2015-01-06 12:29:23 +0000
4@@ -88,7 +88,6 @@
5 action_id,
6 action_label,
7 action_callback,
8- None,
9 None
10 )
11

Subscribers

People subscribed via source and target branches