Merge lp:~macslow/unity8/fix-snap-decision-proxy-model-hack into lp:unity8

Proposed by Mirco Müller
Status: Work in progress
Proposed branch: lp:~macslow/unity8/fix-snap-decision-proxy-model-hack
Merge into: lp:unity8
Prerequisite: lp:~macslow/unity8/swipe-dismiss-snap-decisions
Diff against target: 75 lines (+19/-26)
1 file modified
tests/qmltests/tst_Shell.qml (+19/-26)
To merge this branch: bzr merge lp:~macslow/unity8/fix-snap-decision-proxy-model-hack
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+247573@code.launchpad.net

Commit message

Fixed the snapDecisionProxyModel-hack in tst_Shell.qml, since we now have a proper mocked Notification-model.

Description of the change

Fixed the snapDecisionProxyModel-hack in tst_Shell.qml, since we now have a proper mocked Notification-model.

* Are there any related MPs required for this MP to build/function as expected? Please list.
No (but lp:~macslow/unity8/swipe-dismiss-snap-decisions is a prerequisite)

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

* Did you make sure that your branch does not contain spurious tags?
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.

Unmerged revisions

1282. By Mirco Müller

Fixed the snapDecisionProxyModel-hack in tst_Shell.qml... almost at least, since there's still a bug with mouseClick() not happening or hitting the right button.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/qmltests/tst_Shell.qml'
2--- tests/qmltests/tst_Shell.qml 2015-01-09 10:42:42 +0000
3+++ tests/qmltests/tst_Shell.qml 2015-01-26 12:42:53 +0000
4@@ -30,6 +30,7 @@
5 import Powerd 0.1
6
7 import "../../qml"
8+import "../../qml/Notifications"
9
10 Item {
11 id: root
12@@ -96,16 +97,7 @@
13 }
14 }
15
16- Component {
17- id: mockNotification
18-
19- QtObject {
20- function invokeAction(actionId) {
21- mockNotificationsModel.actionInvoked(actionId)
22- }
23- }
24- }
25- ListModel {
26+ NotificationModel {
27 id: mockNotificationsModel
28
29 signal actionInvoked(string actionId)
30@@ -115,8 +107,8 @@
31 }
32
33 onActionInvoked: {
34- if(actionId == "ok_id") {
35- mockNotificationsModel.clear()
36+ if(action == "ok_id") {
37+ mockNotificationsModel.remove(1)
38 }
39 }
40 }
41@@ -253,20 +245,21 @@
42 }
43
44 function addSnapDecisionNotification() {
45- var n = {
46- type: Notification.SnapDecision,
47- hints: {"x-canonical-private-affirmative-tint": "true"},
48- summary: "Tom Ato",
49- body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
50- icon: "../graphics/avatars/funky.png",
51- secondaryIcon: "../graphics/applicationIcons/facebook.png",
52- actions: [{ id: "ok_id", label: "Ok"},
53- { id: "cancel_id", label: "Cancel"},
54- { id: "notreally_id", label: "Not really"},
55- { id: "noway_id", label: "messages:No way"},
56- { id: "nada_id", label: "messages:Nada"}]
57- }
58-
59+ var component = Qt.createComponent("./Notifications/Notification.qml")
60+ var n = component.createObject("notification", {"nid": 1,
61+ "type": Notification.SnapDecision,
62+ "hints": {"x-canonical-private-affirmative-tint": "true"},
63+ "summary": "Tom Ato",
64+ "body": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
65+ "icon": "../graphics/avatars/funky.png",
66+ "secondaryIcon": "../graphics/applicationIcons/facebook.png",
67+ "rawActions": ["ok_id", "Ok",
68+ "cancel_id", "Cancel",
69+ "notreally_id", "Not really",
70+ "noway_id", "messages:No way",
71+ "nada_id", "messages:Nada"]})
72+ n.completed.connect(mockNotificationsModel.onCompleted)
73+ n.actionInvoked.connect(mockNotificationsModel.actionInvoked)
74 mockNotificationsModel.append(n)
75 }
76

Subscribers

People subscribed via source and target branches