Merge lp:~macslow/unity8/snap-decisions-states into lp:unity8
- snap-decisions-states
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Michael Zanetti |
Approved revision: | 556 |
Merged at revision: | 787 |
Proposed branch: | lp:~macslow/unity8/snap-decisions-states |
Merge into: | lp:unity8 |
Prerequisite: | lp:~macslow/unity8/fix-object-name-of-notification-ap-test |
Diff against target: |
491 lines (+330/-17) 5 files modified
qml/Notifications/Notification.qml (+61/-4) qml/Notifications/Notifications.qml (+4/-0) tests/qmltests/CMakeLists.txt (+1/-0) tests/qmltests/Notifications/tst_Notifications.qml (+27/-13) tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml (+237/-0) |
To merge this branch: | bzr merge lp:~macslow/unity8/snap-decisions-states |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Michael Zanetti (community) | Approve | ||
Andrea Cimitan | Pending | ||
Review via email: mp+210618@code.launchpad.net |
This proposal supersedes a proposal from 2013-11-15.
Commit message
Make visual queue of (up to five) snap-decisions contract and expand according to visual design-spec.
Description of the change
Make visual queue of (up to five) snap-decisions contract and expand according to visual design-spec.
* Are there any related MPs required for this MP to build/function as expected?
There are two prerequiste branches needed for this to work. lp:~macslow/unity8/fix-object-name-of-notification-ap-test for lp:unity8 and lp:~macslow/unity-notifications/dont-ignore-placeholder for lp:unity-notifications
* 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?
Showed http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:535
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:535
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:535
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:536
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:537
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:538
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:538
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:538
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:538
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:538
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
UNSTABLE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:538
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:539
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:540
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:541
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal | # |
15 + var result = "undefined";
I think this should be "" instead of "undefined" otherwise leaving a state might not reset stuff correctly.
===
18 + if (notificationLi
and following lines...
You shouldn't reach out of scope here (Can break if someone. Please either user ListView.view instead of notificationList or move the logic out into the containing ListView.
===
small coding style nitpick
70 anchors.fill: parent
71 - anchors.margins: notification.
72 + anchors.leftMargin: notification.
73 + anchors.
anchors { fill: parent; ... }
===
117 + Component.
118 + if (fullscreen) {
119 + notificationLis
120 + } else {
121 + notificationLis
122 + }
123 + }
Why can't this be a binding in the ListView? Not sure why this needs to be called every time a new delegate is created.
===
Not sure if related to this branch (and if its a real issue after all), but if I trigger sd-example-
===
I'm calling this in a script:
./sd-example-
./sd-example-
./sd-example-
./sd-example-
./sd-example-
./sd-example-
./sd-example-
./sd-example-
./sd-example-
=> unity crashes.
After that I added a sleep 1 in between the lines, it still causes issues and at some point an empty rectangle appears.
===
If the first notification is expanded, and a new one comes in at position 0, the new one shows up expanded and then quickly collapses. I think that might be related to this:
125 + ListView.onAdd: {
126 + if (notificationLi
127 + notificationLis
128 + }
The problem here is that you only correct the currentIndex after everything is built up. If you make it a binding it should work better.
===
207 + wait(500);
Is that a leftover from testing?
===
tests look good. Maybe rename them to give it a more meaningful name? make testVisualQueue does not really tell its notifications.
Mirco Müller (macslow) wrote : | # |
"15 + var result = "undefined";"
fixed
" small coding style nitpick"
fixed
"Why can't this be a binding in the ListView?..."
fixed
"Not sure if related to this branch (and if its a real issue after all), but if I trigger sd-example-
In that example "Decline" is really only for expanding the fake ComboButton to reveal the several real declining options. This will be less confusing once we finally can use the real ComboButton-element from the SDK.
Still working on the other bits.
- 542. By Mirco Müller
-
Fixed the first set of issues from the MP-comments.
- 543. By Mirco Müller
-
More MP-comment fixes.
- 544. By Mirco Müller
-
Fixing more MP-comments... moving more control to bindings.
- 545. By Mirco Müller
-
Rename qml-test for visual snap-decision queue to make it more obvious what it is about.
- 546. By Mirco Müller
-
Typo
Mirco Müller (macslow) wrote : | # |
"If the first notification is expanded, and a new one comes in at position 0..."
fixed
"make testVisualQueue does not really tell its notifications."
fixed
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:543
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:546
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 547. By Mirco Müller
-
Merged mzanetti's wait()-crushing power :)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:547
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 548. By Mirco Müller
-
Got rid of the last wait(), but now have to fight the initialHeight assertion again... :/
- 549. By Mirco Müller
-
Added another WaitForRendering() to make the test pass again... most of the time :/
- 550. By Mirco Müller
-
This second waitForRendering() seems to help fix the issue.
- 551. By Mirco Müller
-
That didn't really help either.
- 552. By Mirco Müller
-
Rather use implicitHeight then height to get the correct value.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:549
http://
Executed test runs:
SUCCESS: http://
None: http://
None: http://
None: http://
SUCCESS: http://
None: http://
SUCCESS: http://
deb: http://
None: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:549
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Mirco Müller (macslow) wrote : | # |
Wait() are all gone and the qml-test passes again. Now it's time to look into the crash.
Mirco Müller (macslow) wrote : | # |
The crash no longer happens. But the edge-case of the fullscreen sim-unlock snap-decision needs to be handled in special way. Since there's no UX-design for this, I will suppress it if there are already snap-decisions in queue or avoid new snap-decisions getting displayed, if there's still a fullscreen snap-decision displayed. That has to happen on the backend though.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:552
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 553. By Mirco Müller
-
Forgot to also use the renamed test in the cmakefile.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:552
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
None: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 554. By Mirco Müller
-
Possible fix for segfault in notification-
qmltest
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:553
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
None: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
None: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:554
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : | # |
> The crash no longer happens. But the edge-case of the fullscreen sim-unlock
> snap-decision needs to be handled in special way. Since there's no UX-design
> for this, I will suppress it if there are already snap-decisions in queue or
> avoid new snap-decisions getting displayed, if there's still a fullscreen
> snap-decision displayed. That has to happen on the backend though.
Not sure I understand correctly, what do you mean with suppressing it? Does that mean delaying it or dropping it? I'm not sure we should just drop it while I guess I'm fine with delaying it until the other notifications have been handled.
Mirco Müller (macslow) wrote : | # |
With suppressing I mean "avoid the fullscreen/pinpad notification move from the internal snap-decisions queue into the displayed queue" until the displayed queue is empty again, thus the fullscreen/pinpad notification would be the only notification being shown.
The other case would apply as well... "don't let any notification move from an internal queue to the displayed-queue until the the fullscreen/pinpad notification is no longer displayed".
Michael Zanetti (mzanetti) wrote : | # |
518 + if (mockModel.count > 5) {
537 + if (mockModel.count > 5) {
551 + if (mockModel.count > 5) {
Why is this? You basically disable the whole test for the first 4 runs. Can't just initialize the model with 5+ notifications if you really require them for the test?
Michael Zanetti (mzanetti) wrote : | # |
> With suppressing I mean "avoid the fullscreen/pinpad notification move from
> the internal snap-decisions queue into the displayed queue" until the
> displayed queue is empty again, thus the fullscreen/pinpad notification would
> be the only notification being shown.
>
> The other case would apply as well... "don't let any notification move from an
> internal queue to the displayed-queue until the the fullscreen/pinpad
> notification is no longer displayed".
ack, so effectively delaying it. works for me.
- 555. By Mirco Müller
-
Add the five test Snap-Decisions for the visual-queue test in one go.
Mirco Müller (macslow) wrote : | # |
As discussed on IRC, the initial idea was to add all five snap-decisions in one go, but I didn't know how QML-test's data-concept worked with this. So now the test snap-decisions are added in one step and the data-concept is not used at all.
- 556. By Mirco Müller
-
Using the fill-model function from the interactive test.
Michael Zanetti (mzanetti) wrote : | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
yes
* Did CI run pass? If not, please explain why.
unrelated mediumtests fail
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:555
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:556
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'qml/Notifications/Notification.qml' |
2 | --- qml/Notifications/Notification.qml 2014-01-03 10:29:25 +0000 |
3 | +++ qml/Notifications/Notification.qml 2014-03-19 11:24:40 +0000 |
4 | @@ -39,20 +39,72 @@ |
5 | |
6 | fullscreen: false |
7 | objectName: "background" |
8 | - implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : contentColumn.height + contentColumn.spacing * 4) : 0 |
9 | + implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : contentColumn.height + contentColumn.spacing * 2) : 0 |
10 | |
11 | color: Qt.rgba(0.132, 0.117, 0.109, 0.97) |
12 | opacity: 0 |
13 | |
14 | + state: { |
15 | + var result = ""; |
16 | + |
17 | + if (type == Notification.SnapDecision) { |
18 | + if (ListView.view.currentIndex == index) { |
19 | + result = "expanded"; |
20 | + } else { |
21 | + if (ListView.view.count > 2) { |
22 | + if (ListView.view.currentIndex == -1 && index == 1) { |
23 | + result = "expanded"; |
24 | + } else { |
25 | + result = "contracted"; |
26 | + } |
27 | + } else { |
28 | + result = "expanded"; |
29 | + } |
30 | + } |
31 | + } |
32 | + |
33 | + return result; |
34 | + } |
35 | + |
36 | + Behavior on height { |
37 | + id: normalHeightBehavior |
38 | + |
39 | + //enabled: menuItemFactory.progress == 1 |
40 | + enabled: true |
41 | + SequentialAnimation { |
42 | + PauseAnimation { |
43 | + duration: UbuntuAnimation.SnapDuration |
44 | + } |
45 | + UbuntuNumberAnimation { |
46 | + duration: UbuntuAnimation.SnapDuration |
47 | + } |
48 | + } |
49 | + } |
50 | + |
51 | + states:[ |
52 | + State { |
53 | + name: "contracted" |
54 | + PropertyChanges {target: notification; height: units.gu(8)} |
55 | + }, |
56 | + State { |
57 | + name: "expanded" |
58 | + PropertyChanges {target: notification; height: implicitHeight} |
59 | + } |
60 | + ] |
61 | + |
62 | clip: fullscreen ? false : true |
63 | + |
64 | visible: type != Notification.PlaceHolder |
65 | |
66 | UbuntuShape { |
67 | id: shapedBack |
68 | |
69 | visible: !fullscreen |
70 | - anchors.fill: parent |
71 | - anchors.margins: notification.margins |
72 | + anchors { |
73 | + fill: parent |
74 | + leftMargin: notification.margins |
75 | + rightMargin: notification.margins |
76 | + } |
77 | color: parent.color |
78 | opacity: parent.opacity |
79 | radius: "medium" |
80 | @@ -104,17 +156,20 @@ |
81 | MouseArea { |
82 | id: interactiveArea |
83 | |
84 | - anchors.fill: contentColumn |
85 | + anchors.fill: parent |
86 | objectName: "interactiveArea" |
87 | onClicked: { |
88 | if (notification.type == Notification.Interactive) { |
89 | notification.notification.invokeAction(actionRepeater.itemAt(0).actionId) |
90 | + } else { |
91 | + notificationList.currentIndex = index; |
92 | } |
93 | } |
94 | } |
95 | |
96 | Column { |
97 | id: contentColumn |
98 | + objectName: "contentColumn" |
99 | |
100 | anchors { |
101 | left: parent.left |
102 | @@ -207,6 +262,8 @@ |
103 | model: unityMenuModel |
104 | |
105 | NotificationMenuItemFactory { |
106 | + id: menuItemFactory |
107 | + |
108 | anchors.left: parent.left; anchors.right: parent.right |
109 | |
110 | menuModel: unityMenuModel |
111 | |
112 | === modified file 'qml/Notifications/Notifications.qml' |
113 | --- qml/Notifications/Notifications.qml 2013-12-18 12:50:55 +0000 |
114 | +++ qml/Notifications/Notifications.qml 2014-03-19 11:24:40 +0000 |
115 | @@ -25,6 +25,9 @@ |
116 | interactive: false |
117 | |
118 | property real margin |
119 | + spacing: delegate.fullscreen ? 0 : units.gu(.5) |
120 | + |
121 | + currentIndex: (currentIndex < 1 && count > 1) ? 1 : -1 |
122 | |
123 | delegate: Notification { |
124 | objectName: "notification" + index |
125 | @@ -75,6 +78,7 @@ |
126 | displaced: Transition { |
127 | UbuntuNumberAnimation { |
128 | properties: "x,y" |
129 | + duration: UbuntuAnimation.SnapDuration |
130 | } |
131 | } |
132 | } |
133 | |
134 | === modified file 'tests/qmltests/CMakeLists.txt' |
135 | --- tests/qmltests/CMakeLists.txt 2014-03-14 12:08:44 +0000 |
136 | +++ tests/qmltests/CMakeLists.txt 2014-03-19 11:24:40 +0000 |
137 | @@ -82,6 +82,7 @@ |
138 | add_qml_test(Hud Result) |
139 | add_qml_test(Launcher Launcher IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
140 | add_qml_test(Notifications Notifications IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins) |
141 | +add_qml_test(Notifications VisualSnapDecisionsQueue IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins) |
142 | add_qml_test(Panel IndicatorRow) |
143 | add_qml_test(Panel Indicators IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
144 | add_qml_test(Panel MenuContent IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
145 | |
146 | === modified file 'tests/qmltests/Notifications/tst_Notifications.qml' |
147 | --- tests/qmltests/Notifications/tst_Notifications.qml 2014-01-03 10:29:25 +0000 |
148 | +++ tests/qmltests/Notifications/tst_Notifications.qml 2014-03-19 11:24:40 +0000 |
149 | @@ -43,6 +43,21 @@ |
150 | function getRaw(id) { |
151 | return mockNotification.createObject(mockModel) |
152 | } |
153 | + |
154 | + // add the default/PlaceHolder notification to the model |
155 | + Component.onCompleted: { |
156 | + var n = { |
157 | + type: Notification.PlaceHolder, |
158 | + hints: {}, |
159 | + summary: "", |
160 | + body: "", |
161 | + icon: "", |
162 | + secondaryIcon: "", |
163 | + actions: [] |
164 | + } |
165 | + |
166 | + append(n) |
167 | + } |
168 | } |
169 | |
170 | function addSnapDecisionNotification() { |
171 | @@ -376,6 +391,8 @@ |
172 | var notification = findChild(notifications, "notification" + (mockModel.count - 1)) |
173 | verify(notification !== undefined, "notification wasn't found"); |
174 | |
175 | + waitForRendering(notification); |
176 | + |
177 | var icon = findChild(notification, "icon") |
178 | var shapedIcon = findChild(notification, "shapedIcon") |
179 | var nonShapedIcon = findChild(notification, "nonShapedIcon") |
180 | @@ -384,7 +401,6 @@ |
181 | var summaryLabel = findChild(notification, "summaryLabel") |
182 | var bodyLabel = findChild(notification, "bodyLabel") |
183 | var buttonRow = findChild(notification, "buttonRow") |
184 | - waitForRendering(buttonRow) |
185 | |
186 | compare(icon.visible, data.iconVisible, "avatar-icon visibility is incorrect") |
187 | compare(shapedIcon.visible, data.shapedIcon, "shaped-icon visibility is incorrect") |
188 | @@ -407,12 +423,9 @@ |
189 | var buttonCancel = findChild(buttonRow, "button1") |
190 | var buttonAccept = findChild(buttonRow, "button0") |
191 | |
192 | - waitForRendering(notification) |
193 | - |
194 | // only test the left/cancel-button if two actions have been passed in |
195 | if (data.actions.length == 2) { |
196 | - mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2) |
197 | - actionSpy.wait() |
198 | + tryCompareFunction(function() { mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2); return actionSpy.signalArguments.length > 0; }, true); |
199 | compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action") |
200 | actionSpy.clear() |
201 | } |
202 | @@ -421,38 +434,39 @@ |
203 | verify(buttonAccept.gradient === data.buttonTinted ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient, "button has the wrong color-tint") |
204 | |
205 | // click the positive/right button |
206 | - mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2) |
207 | - actionSpy.wait() |
208 | + tryCompareFunction(function() { mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2); return actionSpy.signalArguments.length > 0; }, true); |
209 | compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action") |
210 | actionSpy.clear() |
211 | + waitForRendering(notification) |
212 | |
213 | // check if there's more than one negative choice |
214 | if (data.actions.length > 2) { |
215 | - var initialHeight = notification.height |
216 | + var initialHeight = notification.implicitHeight |
217 | |
218 | // click to expand |
219 | mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2) |
220 | - waitForRendering(notification) |
221 | + var contentColumn = findChild(notification, "contentColumn") |
222 | + var collapsedContentColumnHeight = contentColumn.height; |
223 | + // Waiting for the inner column to change height because buttons appear |
224 | + tryCompareFunction(function() { return collapsedContentColumnHeight != contentColumn.height; }, true); |
225 | + // Waiting for notification to reach its target size |
226 | + tryCompare(notification, "height", contentColumn.height + contentColumn.spacing * 2) |
227 | actionSpy.clear() |
228 | |
229 | // test the additional buttons |
230 | for (var i = 2; i < data.actions.length; i++) { |
231 | - waitForRendering(notification) |
232 | var buttonColumn = findChild(notification, "buttonColumn") |
233 | var button = findChild(buttonColumn, "button" + i) |
234 | mouseClick(button, button.width / 2, button.height / 2) |
235 | - actionSpy.wait() |
236 | compare(actionSpy.signalArguments[0][0], data.actions[i]["id"], "got wrong id for additional negative action") |
237 | actionSpy.clear() |
238 | } |
239 | |
240 | // click to collapse |
241 | mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2) |
242 | - waitForRendering(notification) |
243 | tryCompare(notification, "height", initialHeight) |
244 | } else { |
245 | mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2) |
246 | - actionSpy.wait() |
247 | compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action") |
248 | } |
249 | } |
250 | |
251 | === added file 'tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml' |
252 | --- tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml 1970-01-01 00:00:00 +0000 |
253 | +++ tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml 2014-03-19 11:24:40 +0000 |
254 | @@ -0,0 +1,237 @@ |
255 | +/* |
256 | + * Copyright (C) 2014 Canonical, Ltd. |
257 | + * |
258 | + * This program is free software; you can redistribute it and/or modify |
259 | + * it under the terms of the GNU General Public License as published by |
260 | + * the Free Software Foundation; version 3. |
261 | + * |
262 | + * This program is distributed in the hope that it will be useful, |
263 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
264 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
265 | + * GNU General Public License for more details. |
266 | + * |
267 | + * You should have received a copy of the GNU General Public License |
268 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
269 | + */ |
270 | + |
271 | +import QtQuick 2.0 |
272 | +import QtTest 1.0 |
273 | +import ".." |
274 | +import "../../../qml/Notifications" |
275 | +import Ubuntu.Components 0.1 |
276 | +import Unity.Test 0.1 |
277 | +import Unity.Notifications 1.0 |
278 | + |
279 | +Row { |
280 | + id: rootRow |
281 | + |
282 | + Component { |
283 | + id: mockNotification |
284 | + |
285 | + QtObject { |
286 | + function invokeAction(actionId) { |
287 | + mockModel.actionInvoked(actionId) |
288 | + } |
289 | + } |
290 | + } |
291 | + |
292 | + ListModel { |
293 | + id: mockModel |
294 | + |
295 | + signal actionInvoked(string actionId) |
296 | + |
297 | + function getRaw(id) { |
298 | + return mockNotification.createObject(mockModel) |
299 | + } |
300 | + |
301 | + // add the default/PlaceHolder notification to the model |
302 | + Component.onCompleted: { |
303 | + var n = { |
304 | + type: Notification.PlaceHolder, |
305 | + hints: {}, |
306 | + summary: "", |
307 | + body: "", |
308 | + icon: "", |
309 | + secondaryIcon: "", |
310 | + actions: [] |
311 | + } |
312 | + |
313 | + append(n) |
314 | + } |
315 | + } |
316 | + |
317 | + function addSomeSnapDecisionNotifications() { |
318 | + var n = [{ |
319 | + type: Notification.SnapDecision, |
320 | + hints: {"x-canonical-private-button-tint": "true"}, |
321 | + summary: "Incoming call", |
322 | + body: "Frank Zappa\n+44 (0)7736 027340", |
323 | + icon: "../graphics/avatars/funky.png", |
324 | + secondaryIcon: "../graphics/applicationIcons/phone-app.png", |
325 | + actions: [{ id: "pickup_id", label: "Pick up"}, |
326 | + { id: "decline_1_id", label: "Decline"}, |
327 | + { id: "decline_2_id", label: "Can't talk now, what's up?"}, |
328 | + { id: "decline_3_id", label: "I call you back."}, |
329 | + { id: "decline_4_id", label: "Send custom message..."}] |
330 | + }, |
331 | + { |
332 | + type: Notification.SnapDecision, |
333 | + hints: {"x-canonical-private-button-tint": "true", |
334 | + "x-canonical-non-shaped-icon": "true"}, |
335 | + summary: "Incoming file", |
336 | + body: "Frank would like to send you the file: essay.pdf.", |
337 | + icon: "image://theme/search", |
338 | + actions: [{ id: "accept_id", label: "Accept"}, |
339 | + { id: "reject_id", label: "Reject"}] |
340 | + }, |
341 | + { |
342 | + type: Notification.SnapDecision, |
343 | + hints: {"x-canonical-private-button-tint": "true", |
344 | + "x-canonical-non-shaped-icon": "true"}, |
345 | + summary: "Authentication error", |
346 | + body: "Please authorise Ubuntu to access your Google account.", |
347 | + icon: "image://theme/search", |
348 | + actions: [{ id: "settings_id", label: "Settings..."}, |
349 | + { id: "cancel_id", label: "Cancel"}] |
350 | + }, |
351 | + { |
352 | + type: Notification.SnapDecision, |
353 | + hints: {"x-canonical-private-button-tint": "true", |
354 | + "x-canonical-non-shaped-icon": "true"}, |
355 | + summary: "Morning alarm", |
356 | + body: "It's 6:30... time to get up!", |
357 | + icon: "image://theme/search", |
358 | + actions: [{ id: "ok_reply", label: "Ok"}, |
359 | + { id: "snooze_id", label: "Snooze"}] |
360 | + }, |
361 | + { |
362 | + type: Notification.SnapDecision, |
363 | + hints: {"x-canonical-private-button-tint": "true"}, |
364 | + summary: "Jenny Sample", |
365 | + body: "Hey there! Have you been watching the latest episode of that TV-show I told you about last week?", |
366 | + icon: "../graphics/avatars/amanda.png", |
367 | + secondaryIcon: "../graphics/applicationIcons/messages-app.png", |
368 | + actions: [{ id: "reply_id", label: "Reply"}, |
369 | + { id: "ignore_id", label: "Ignore"}] |
370 | + }] |
371 | + |
372 | + mockModel.append(n) |
373 | + } |
374 | + |
375 | + function clearNotifications() { |
376 | + // remove all but the first (PlaceHolder) notification |
377 | + mockModel.remove(1, mockModel.count - 1) |
378 | + } |
379 | + |
380 | + function removeTopMostNotification() { |
381 | + // leave real/first (PlaceHolder) notification untouched |
382 | + if (mockModel.count > 1) |
383 | + mockModel.remove(1) |
384 | + } |
385 | + |
386 | + Rectangle { |
387 | + id: notificationsRect |
388 | + |
389 | + width: units.gu(40) |
390 | + height: units.gu(71) |
391 | + |
392 | + MouseArea{ |
393 | + id: clickThroughCatcher |
394 | + |
395 | + anchors.fill: parent |
396 | + } |
397 | + |
398 | + Notifications { |
399 | + id: notifications |
400 | + |
401 | + margin: units.gu(1) |
402 | + |
403 | + anchors.fill: parent |
404 | + model: mockModel |
405 | + } |
406 | + } |
407 | + |
408 | + Rectangle { |
409 | + id: interactiveControls |
410 | + |
411 | + width: units.gu(30) |
412 | + height: units.gu(81) |
413 | + color: "grey" |
414 | + |
415 | + Column { |
416 | + spacing: units.gu(1) |
417 | + anchors.fill: parent |
418 | + anchors.margins: units.gu(1) |
419 | + |
420 | + Button { |
421 | + width: parent.width |
422 | + text: "add some snap-decisions" |
423 | + onClicked: addSomeSnapDecisionNotifications() |
424 | + } |
425 | + |
426 | + Button { |
427 | + width: parent.width |
428 | + text: "remove top-most notification" |
429 | + onClicked: removeTopMostNotification() |
430 | + } |
431 | + |
432 | + Button { |
433 | + width: parent.width |
434 | + text: "clear model" |
435 | + onClicked: clearNotifications() |
436 | + } |
437 | + } |
438 | + } |
439 | + |
440 | + UnityTestCase { |
441 | + id: root |
442 | + name: "VisualQueueTest" |
443 | + when: windowShown |
444 | + |
445 | + function test_VisualSnapDecisionsQueue() { |
446 | + // populate model with some mock notifications |
447 | + addSomeSnapDecisionNotifications(); |
448 | + |
449 | + // make sure the view is properly updated before going on |
450 | + waitForRendering(notifications); |
451 | + |
452 | + var snap_decision = [findChild(notifications, "notification1"), |
453 | + findChild(notifications, "notification2"), |
454 | + findChild(notifications, "notification3"), |
455 | + findChild(notifications, "notification4"), |
456 | + findChild(notifications, "notification5")] |
457 | + |
458 | + for (var index = 0; index < snap_decision.length; index++) { |
459 | + verify(snap_decision[index] !== undefined, index + ". snap-decision wasn't found"); |
460 | + } |
461 | + |
462 | + // check initial states once all five snap-decisions were appended to the model |
463 | + compare(snap_decision[0].state, "expanded", "state of first snap-decision is not expanded"); |
464 | + for (var index = 1; index < snap_decision.length; index++) { |
465 | + compare(snap_decision[index].state, "contracted", "state of "+ index + ".snap-decision is not contracted"); |
466 | + } |
467 | + |
468 | + // click/tap on each snap-decision and verify only one is in expanded-state at any time |
469 | + for (var index = 0; index < snap_decision.length; index++) { |
470 | + mouseClick(snap_decision[index], snap_decision[index].width / 2, snap_decision[index].height / 2) |
471 | + for (var kindex = 0; kindex < snap_decision.length; kindex++) { |
472 | + if (kindex == index) { |
473 | + compare(snap_decision[kindex].state, "expanded", "state of "+ kindex + ".snap-decision is not expanded"); |
474 | + } else { |
475 | + compare(snap_decision[kindex].state, "contracted", "state of "+ kindex + ".snap-decision is not contracted"); |
476 | + } |
477 | + } |
478 | + } |
479 | + |
480 | + // remove top-most and verify one of the remaining ones is still getting expanded |
481 | + |
482 | + // make first snap-decision expand |
483 | + mouseClick(snap_decision[0], snap_decision[0].width / 2, snap_decision[0].height / 2); |
484 | + |
485 | + for (var index = 1; index < snap_decision.length; index++) { |
486 | + removeTopMostNotification(); |
487 | + compare(snap_decision[index].state, "expanded", "state of " + index + ". snap-decision is not expanded"); |
488 | + } |
489 | + } |
490 | + } |
491 | +} |
FAILED: Continuous integration, rev:534 jenkins. qa.ubuntu. com/job/ unity8- ci/2287/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty/ 3068/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty- touch/2781/ console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- trusty/ 1158/console jenkins. qa.ubuntu. com/job/ unity8- trusty- amd64-ci/ 809/console jenkins. qa.ubuntu. com/job/ unity8- trusty- armhf-ci/ 811/console jenkins. qa.ubuntu. com/job/ unity8- trusty- i386-ci/ 809/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/3070/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/2782/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/2287/ rebuild
http://