Merge lp:~macslow/unity-notifications/dont-ignore-placeholder into lp:unity-notifications

Proposed by Mirco Müller
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 198
Merged at revision: 199
Proposed branch: lp:~macslow/unity-notifications/dont-ignore-placeholder
Merge into: lp:unity-notifications
Diff against target: 79 lines (+9/-9)
5 files modified
examples/sd-example-incoming-file.py (+1/-1)
examples/sd-example-much-body-text.py (+1/-1)
examples/sd-example-using-button-tint-hint.py (+1/-1)
src/NotificationModel.cpp (+1/-1)
test/notificationtest.cpp (+5/-5)
To merge this branch: bzr merge lp:~macslow/unity-notifications/dont-ignore-placeholder
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+206950@code.launchpad.net

Commit message

Updated NotificationModel and its unit-test to not ignore the permanent PlaceHolder notification in the queue.

Description of the change

Updated NotificationModel and its unit-test to not ignore the permanent PlaceHolder notification in the queue.

* Are there any related MPs required for this MP to build/function as expected?
This MP is related...
* https://code.launchpad.net/~macslow/unity8/fix-object-name-of-notification-ap-test/+merge/210588

* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes.

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable.

* If you changed the UI, has there been a design review?
Not applicable.

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
Albert Astals Cid (aacid) wrote :

Are the examples related to the other changes? I can't see how

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) wrote :

Is there any bug that this change is fixing? Also is it possible to have a testcase that fails without this change but works with it? (Besides the tests you changed)

review: Needs Information
Revision history for this message
Mirco Müller (macslow) wrote :

The icon-changes in the examples are unrelated and just cosmetics.

There's only testVisualSDQueueWithoutCritical(). Why would it need an additional test?

Revision history for this message
Albert Astals Cid (aacid) wrote :

This seems to make unity8.shell.tests.test_notifications.InteractiveNotificationBase.test_sd_incoming_call fail. Is that correct?

review: Needs Information
Revision history for this message
Mirco Müller (macslow) wrote :

That should not happen :/ This is new. I need to look into this.

Revision history for this message
Mirco Müller (macslow) wrote :

The notification AP-test "test_sd_incoming_call" does not use the correct objectName "notification1", but "notification0". The PlaceHolder notification in the model has "notification0". So no AP-test should look for "notification0".

I'll push a fixing branch to unity8 to go alongside with this one.

Revision history for this message
Mirco Müller (macslow) wrote :

I've updated the MP-summary with a link to the fixing MP for unity8. See https://code.launchpad.net/~macslow/unity8/fix-object-name-of-notification-ap-test/+merge/210588

Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/sd-example-incoming-file.py'
--- examples/sd-example-incoming-file.py 2013-10-31 12:55:18 +0000
+++ examples/sd-example-incoming-file.py 2014-02-18 14:55:55 +0000
@@ -81,7 +81,7 @@
81 loop = gobject.MainLoop ()81 loop = gobject.MainLoop ()
82 n = pushNotification ("Incoming file",82 n = pushNotification ("Incoming file",
83 "Frank would like to send you the file: essay.pdf",83 "Frank would like to send you the file: essay.pdf",
84 "document")84 "sync-idle")
85 n.connect ("closed", example.closedHandler, loop)85 n.connect ("closed", example.closedHandler, loop)
8686
87 loop.run ()87 loop.run ()
8888
=== modified file 'examples/sd-example-much-body-text.py'
--- examples/sd-example-much-body-text.py 2013-10-31 12:55:18 +0000
+++ examples/sd-example-much-body-text.py 2014-02-18 14:55:55 +0000
@@ -85,7 +85,7 @@
85 loop = gobject.MainLoop ()85 loop = gobject.MainLoop ()
86 n = pushNotification ("Uses much text",86 n = pushNotification ("Uses much text",
87 "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",87 "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
88 "info")88 "messages")
89 n.connect ("closed", example.closedHandler, loop)89 n.connect ("closed", example.closedHandler, loop)
9090
91 loop.run ()91 loop.run ()
9292
=== modified file 'examples/sd-example-using-button-tint-hint.py'
--- examples/sd-example-using-button-tint-hint.py 2013-10-31 12:55:18 +0000
+++ examples/sd-example-using-button-tint-hint.py 2014-02-18 14:55:55 +0000
@@ -85,7 +85,7 @@
85 loop = gobject.MainLoop ()85 loop = gobject.MainLoop ()
86 n = pushNotification ("Question",86 n = pushNotification ("Question",
87 "Would you say Ok or Cancel?",87 "Would you say Ok or Cancel?",
88 "info")88 "search")
89 n.connect ("closed", example.closedHandler, loop)89 n.connect ("closed", example.closedHandler, loop)
9090
91 loop.run ()91 loop.run ()
9292
=== modified file 'src/NotificationModel.cpp'
--- src/NotificationModel.cpp 2014-01-16 15:13:04 +0000
+++ src/NotificationModel.cpp 2014-02-18 14:55:55 +0000
@@ -441,7 +441,7 @@
441 }441 }
442442
443 if (!inserted) {443 if (!inserted) {
444 insertToVisible(n, 0);444 insertToVisible(n, 1);
445 }445 }
446 }446 }
447}447}
448448
=== modified file 'test/notificationtest.cpp'
--- test/notificationtest.cpp 2014-01-27 16:00:55 +0000
+++ test/notificationtest.cpp 2014-02-18 14:55:55 +0000
@@ -156,7 +156,7 @@
156 m.insertNotification(n3);156 m.insertNotification(n3);
157 m.insertNotification(n4);157 m.insertNotification(n4);
158158
159 QCOMPARE(m.getDisplayedNotification(0)->getBody(), QString("snap-decision-critical"));159 QCOMPARE(m.getDisplayedNotification(1)->getBody(), QString("snap-decision-critical"));
160}160}
161161
162void TestNotifications::testVisualSDQueueWithoutCritical() {162void TestNotifications::testVisualSDQueueWithoutCritical() {
@@ -173,10 +173,10 @@
173 m.insertNotification(n3);173 m.insertNotification(n3);
174 m.insertNotification(n4);174 m.insertNotification(n4);
175175
176 QCOMPARE(m.getDisplayedNotification(3)->getBody(), QString("snap-decision-1"));176 QCOMPARE(m.getDisplayedNotification(4)->getBody(), QString("snap-decision-1"));
177 QCOMPARE(m.getDisplayedNotification(2)->getBody(), QString("snap-decision-2"));177 QCOMPARE(m.getDisplayedNotification(3)->getBody(), QString("snap-decision-2"));
178 QCOMPARE(m.getDisplayedNotification(1)->getBody(), QString("snap-decision-3"));178 QCOMPARE(m.getDisplayedNotification(2)->getBody(), QString("snap-decision-3"));
179 QCOMPARE(m.getDisplayedNotification(0)->getBody(), QString("snap-decision-4"));179 QCOMPARE(m.getDisplayedNotification(1)->getBody(), QString("snap-decision-4"));
180}180}
181181
182QTEST_MAIN(TestNotifications)182QTEST_MAIN(TestNotifications)

Subscribers

People subscribed via source and target branches

to all changes: