Merge lp:~josharenson/unity8/qa_helpers into lp:unity8
- qa_helpers
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Albert Astals Cid |
Approved revision: | 1767 |
Merged at revision: | 1823 |
Proposed branch: | lp:~josharenson/unity8/qa_helpers |
Merge into: | lp:unity8 |
Diff against target: |
620 lines (+238/-166) 12 files modified
qml/Greeter/ShimGreeter.qml (+45/-0) qml/Shell.qml (+56/-43) qml/Stages/ShimStage.qml (+44/-0) tests/autopilot/unity8/application_lifecycle/tests/__init__.py (+2/-2) tests/autopilot/unity8/greeter/__init__.py (+52/-0) tests/autopilot/unity8/indicators/tests/__init__.py (+1/-1) tests/autopilot/unity8/process_helpers.py (+9/-96) tests/autopilot/unity8/shell/tests/test_emulators.py (+2/-2) tests/autopilot/unity8/shell/tests/test_notifications.py (+22/-22) tests/qmltests/Tutorial/tst_Tutorial.qml (+1/-0) tests/qmltests/tst_Shell.qml (+2/-0) tests/qmltests/tst_ShellWithPin.qml (+2/-0) |
To merge this branch: | bzr merge lp:~josharenson/unity8/qa_helpers |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Zanetti (community) | Abstain | ||
Albert Astals Cid (community) | Abstain | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Leo Arias (community) | Approve | ||
Review via email: mp+258435@code.launchpad.net |
Commit message
Refactor greeter emulator to unlock the greeter via dbus
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
No
* 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?
N/A
PS Jenkins bot (ps-jenkins) wrote : | # |
Leo Arias (elopio) wrote : | # |
Thanks Josh.
A couple of things.
The idea is to use these helpers before autopilot comes to play, so it's better to keep them at the module level instead of getting them as methods in the greeter autopilot custom proxy object.
The namespace of helpers is currently a little mess, so I would put them in tests/autopilot
https:/
Next, I think we can remove the other part of unlock calling wait_for_greeter. But I'm not quite sure about this.
Take a look at my diff: http://
Be warned that I didn't have time to run it, so my assumptions might be wrong or I might have left a stupid mistake.
Last think, please make sure that the code you touch passes the static checks. Call:
python3 -m flake8 .
I'm leaving for lunch, but I'll have time later and tomorrow, in case you need me.
Josh Arenson (josharenson) wrote : | # |
Added a way to lock the greeter via dbus too. Makes everything simpler and eliminates a bit of namespace pollution. The wait_for_greeter check is just run in reverse for the lock. The few manual test I ran seemed ok.
Leo Arias (elopio) wrote : | # |
Cool! Even more than what I asked for.
You have these flake8 errors:
http://
And you can now remove the unity_proxy_obj argument from:
67 def unlock_
120 def lock_unity(
Josh Arenson (josharenson) wrote : | # |
Fixed :-)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1762
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1764
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Leo Arias (elopio) wrote : | # |
oh crap. Removing the argument from unlock caused a lot of failures from the tests that were passing it.
Josh Arenson (josharenson) wrote : | # |
> oh crap. Removing the argument from unlock caused a lot of failures from the
> tests that were passing it.
Humm so add an unused arg or refactor everything... I'll try the refactor first and see how ugly it gets.
Josh Arenson (josharenson) wrote : | # |
Refactored.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1766
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Josh Arenson (josharenson) wrote : | # |
> FAILED: Continuous integration, rev:1766
> http://
> Executed test runs:
> UNSTABLE: http://
> touch/2688
> SUCCESS: http://
> vivid/856
> SUCCESS: http://
> SUCCESS: http://
> UNSTABLE: http://
> vivid-mako/2325
> SUCCESS: http://
> vivid-armhf/2686
> deb: http://
> vivid-armhf/
> SUCCESS: http://
>
> Click here to trigger a rebuild:
> http://
The failed AP test runs just fine locally...
Albert Astals Cid (aacid) wrote : | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
If it's good for Leo it's good for us
* Did CI run pass?
Known broken AP test
* Did you make sure that the branch does not contain spurious tags?
Yes
Albert Astals Cid (aacid) wrote : | # |
Text conflict in tests/autopilot
Text conflict in tests/autopilot
2 conflicts encountered.
- 1767. By Josh Arenson
-
Resolved merge conflicts
[ Albert Astals Cid ]
* Make runtests fake a test error if make fails
* Make the test more stable
* Use dbus-test-runner instead of dbus-launch
* DirectionalDragArea: improvements & API grooming (LP: #1417920)
* Fix EdgeDragEvaluator when a drag can happen both ways
(Direction.Horizontal)
[ Josh Arenson ]
* Remove panelHeight property as it is unused.
[ Leo Arias ]
* Initial clean up of the autopilot tests set up. Removed the touch
device from the test case. Moved the restart of unity to a fixture.
Removed the unused DragMixin. Updated the setUpClass to use
process_helpers. Removed the workaround for bug #1238417, already
fixed. Use the toolkit helper to set the testability environment
variable. Fixed the indicators base class that was restarting unity
twice. (LP: #1238417, #1447206)
* Use the base class from the toolkit in autopilot tests.
[ Michael Zanetti ]
* emit application-stop when we're going down (LP: #1326513)
[ Michał Sawicz ]
* UNITY_SCOPES_LIST is no more
[ handsome_feng<email address hidden> ]
* When click the favorite scope in Dash Manager , it just return to
the corresponding scope page. (LP: #1447056)
Josh Arenson (josharenson) wrote : | # |
Resolved and striped tags.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1767
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1767
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) : | # |
Michael Zanetti (mzanetti) wrote : | # |
Needs a merge
- 1768. By Josh Arenson
-
* No-change rebuild against Qt 5.4.2.
[ Michał Sawicz ]
* Implement full-shell rotation (LP: #1210199)
[ CI Train Bot ]
* New rebuild forced.
* Resync trunk.
[ Daniel d'Andrada ]
* Implemented autopilot-test and fake-sensors for shell-rotation.
[ Mirco Müller ]
* Implemented autopilot-test and fake-sensors for shell-rotation.
[ CI Train Bot ]
* New rebuild forced.
* Resync trunk.
[ Renato Araujo Oliveira Filho ]
* Set the device led color to green. (LP: #1450894)
[ Albert Astals Cid ]
* Add overrides to override functions
* Implement "rating-edit" preview widget (LP: #1318144)
* Make the DashContent::test_mainNavig ation test more stable (LP:
#1450809)
* Use art height as implicitHeight when the header is overlayed and
there's no summary
[ CI Train Bot ]
* New rebuild forced.
* Resync trunk.
[ Daniel d'Andrada ]
* Introducing FloatingFlickable
* Make Ubuntu.Gestures components install TouchRegistry by themselves
[ Michael Terry ]
* Fix a possible crash in our PAM threading code. (LP: #1425362) (LP:
#1425362)
* Fix the lockscreen becoming unresponsive after testing an app on the
device from QtCreator. (LP: #1435364)
[ Nick Dedekind ]
* Fixed desktop stage app focus.
* Fixed issue in laggy indicator autpilot tests (LP: #1446846)
[ Albert Astals Cid ]
* Workarounds for concierge mode.
[ CI Train Bot ]
* New rebuild forced.
* Resync trunk.
Michael Zanetti (mzanetti) : | # |
Preview Diff
1 | === added file 'qml/Greeter/ShimGreeter.qml' | |||
2 | --- qml/Greeter/ShimGreeter.qml 1970-01-01 00:00:00 +0000 | |||
3 | +++ qml/Greeter/ShimGreeter.qml 2015-06-16 19:33:06 +0000 | |||
4 | @@ -0,0 +1,45 @@ | |||
5 | 1 | /* | ||
6 | 2 | * Copyright (C) 2015 Canonical, Ltd. | ||
7 | 3 | * | ||
8 | 4 | * This program is free software; you can redistribute it and/or modify | ||
9 | 5 | * it under the terms of the GNU General Public License as published by | ||
10 | 6 | * the Free Software Foundation; version 3. | ||
11 | 7 | * | ||
12 | 8 | * This program is distributed in the hope that it will be useful, | ||
13 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | 11 | * GNU General Public License for more details. | ||
16 | 12 | * | ||
17 | 13 | * You should have received a copy of the GNU General Public License | ||
18 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | 15 | */ | ||
20 | 16 | |||
21 | 17 | import QtQuick 2.3 | ||
22 | 18 | |||
23 | 19 | /* | ||
24 | 20 | * This is a shim greeter that is only used to provide a shell, | ||
25 | 21 | * running without a greeter, the requisite information | ||
26 | 22 | * | ||
27 | 23 | */ | ||
28 | 24 | |||
29 | 25 | /* FIXME: this shuld be fine as a QtObject, but bug lp:1447391 | ||
30 | 26 | * dictates wrapping as an item instead | ||
31 | 27 | */ | ||
32 | 28 | Item { | ||
33 | 29 | id: shimGreeter | ||
34 | 30 | |||
35 | 31 | readonly property bool active: false | ||
36 | 32 | readonly property bool hasLockedApp: lockedApp !== "" | ||
37 | 33 | readonly property bool locked: false | ||
38 | 34 | readonly property bool shown: false | ||
39 | 35 | readonly property bool waiting: false | ||
40 | 36 | |||
41 | 37 | property string lockedApp: "" | ||
42 | 38 | |||
43 | 39 | // Since ShimGreeter is never active, these can just return | ||
44 | 40 | property var forceShow: (function() { return; }) | ||
45 | 41 | property var notifyAboutToFocusApp: (function(appId) { return; }) | ||
46 | 42 | property var notifyAppFocused: (function(appId) { return; }) | ||
47 | 43 | property var notifyShowingDashFromDrag: (function(appId) { return false; }) | ||
48 | 44 | |||
49 | 45 | } | ||
50 | 0 | 46 | ||
51 | === modified file 'qml/Shell.qml' | |||
52 | --- qml/Shell.qml 2015-06-12 16:07:43 +0000 | |||
53 | +++ qml/Shell.qml 2015-06-16 19:33:06 +0000 | |||
54 | @@ -111,6 +111,8 @@ | |||
55 | 111 | // This is _only_ used to expose the property to autopilot tests | 111 | // This is _only_ used to expose the property to autopilot tests |
56 | 112 | readonly property string testShellMode: shellMode | 112 | readonly property string testShellMode: shellMode |
57 | 113 | 113 | ||
58 | 114 | readonly property alias greeter: greeterLoader.item | ||
59 | 115 | |||
60 | 114 | function activateApplication(appId) { | 116 | function activateApplication(appId) { |
61 | 115 | if (ApplicationManager.findApplication(appId)) { | 117 | if (ApplicationManager.findApplication(appId)) { |
62 | 116 | ApplicationManager.requestFocusApplication(appId); | 118 | ApplicationManager.requestFocusApplication(appId); |
63 | @@ -262,7 +264,9 @@ | |||
64 | 262 | ? "phone" | 264 | ? "phone" |
65 | 263 | : shell.usageScenario | 265 | : shell.usageScenario |
66 | 264 | source: { | 266 | source: { |
68 | 265 | if (applicationsDisplayLoader.usageScenario === "phone") { | 267 | if(shellMode === "greeter") { |
69 | 268 | return "Stages/ShimStage.qml" | ||
70 | 269 | } else if (applicationsDisplayLoader.usageScenario === "phone") { | ||
71 | 266 | return "Stages/PhoneStage.qml"; | 270 | return "Stages/PhoneStage.qml"; |
72 | 267 | } else if (applicationsDisplayLoader.usageScenario === "tablet") { | 271 | } else if (applicationsDisplayLoader.usageScenario === "tablet") { |
73 | 268 | return "Stages/TabletStage.qml"; | 272 | return "Stages/TabletStage.qml"; |
74 | @@ -414,50 +418,59 @@ | |||
75 | 414 | } | 418 | } |
76 | 415 | } | 419 | } |
77 | 416 | 420 | ||
88 | 417 | Greeter { | 421 | Loader { |
89 | 418 | id: greeter | 422 | id: greeterLoader |
80 | 419 | objectName: "greeter" | ||
81 | 420 | |||
82 | 421 | hides: [launcher, panel.indicators] | ||
83 | 422 | tabletMode: shell.usageScenario !== "phone" | ||
84 | 423 | launcherOffset: launcher.progress | ||
85 | 424 | forcedUnlock: tutorial.running | ||
86 | 425 | background: shell.background | ||
87 | 426 | |||
90 | 427 | anchors.fill: parent | 423 | anchors.fill: parent |
91 | 428 | anchors.topMargin: panel.panelHeight | 424 | anchors.topMargin: panel.panelHeight |
124 | 429 | 425 | sourceComponent: shellMode != "shell" ? integratedGreeter : | |
125 | 430 | // avoid overlapping with Launcher's edge drag area | 426 | Qt.createComponent(Qt.resolvedUrl("Greeter/ShimGreeter.qml")); |
126 | 431 | // FIXME: Fix TouchRegistry & friends and remove this workaround | 427 | onLoaded: { |
127 | 432 | // Issue involves launcher's DDA getting disabled on a long | 428 | item.objectName = "greeter" |
128 | 433 | // left-edge drag | 429 | } |
129 | 434 | dragHandleLeftMargin: launcher.available ? launcher.dragAreaWidth + 1 : 0 | 430 | } |
130 | 435 | 431 | ||
131 | 436 | onSessionStarted: { | 432 | Component { |
132 | 437 | launcher.hide(); | 433 | id: integratedGreeter |
133 | 438 | } | 434 | Greeter { |
134 | 439 | 435 | ||
135 | 440 | onTease: { | 436 | hides: [launcher, panel.indicators] |
136 | 441 | if (!tutorial.running) { | 437 | tabletMode: shell.sideStageEnabled |
137 | 442 | launcher.tease(); | 438 | launcherOffset: launcher.progress |
138 | 443 | } | 439 | forcedUnlock: tutorial.running |
139 | 444 | } | 440 | background: shell.background |
140 | 445 | 441 | ||
141 | 446 | onEmergencyCall: startLockedApp("dialer-app") | 442 | // avoid overlapping with Launcher's edge drag area |
142 | 447 | 443 | // FIXME: Fix TouchRegistry & friends and remove this workaround | |
143 | 448 | Timer { | 444 | // Issue involves launcher's DDA getting disabled on a long |
144 | 449 | // See powerConnection for why this is useful | 445 | // left-edge drag |
145 | 450 | id: showGreeterDelayed | 446 | dragHandleLeftMargin: launcher.available ? launcher.dragAreaWidth + 1 : 0 |
146 | 451 | interval: 1 | 447 | |
147 | 452 | onTriggered: { | 448 | onSessionStarted: { |
148 | 453 | greeter.forceShow(); | 449 | launcher.hide(); |
149 | 454 | } | 450 | } |
150 | 455 | } | 451 | |
151 | 456 | 452 | onTease: { | |
152 | 457 | Binding { | 453 | if (!tutorial.running) { |
153 | 458 | target: ApplicationManager | 454 | launcher.tease(); |
154 | 459 | property: "suspended" | 455 | } |
155 | 460 | value: greeter.shown | 456 | } |
156 | 457 | |||
157 | 458 | onEmergencyCall: startLockedApp("dialer-app") | ||
158 | 459 | |||
159 | 460 | Binding { | ||
160 | 461 | target: ApplicationManager | ||
161 | 462 | property: "suspended" | ||
162 | 463 | value: greeter.shown | ||
163 | 464 | } | ||
164 | 465 | } | ||
165 | 466 | } | ||
166 | 467 | |||
167 | 468 | Timer { | ||
168 | 469 | // See powerConnection for why this is useful | ||
169 | 470 | id: showGreeterDelayed | ||
170 | 471 | interval: 1 | ||
171 | 472 | onTriggered: { | ||
172 | 473 | greeter.forceShow(); | ||
173 | 461 | } | 474 | } |
174 | 462 | } | 475 | } |
175 | 463 | 476 | ||
176 | 464 | 477 | ||
177 | === added file 'qml/Stages/ShimStage.qml' | |||
178 | --- qml/Stages/ShimStage.qml 1970-01-01 00:00:00 +0000 | |||
179 | +++ qml/Stages/ShimStage.qml 2015-06-16 19:33:06 +0000 | |||
180 | @@ -0,0 +1,44 @@ | |||
181 | 1 | /* | ||
182 | 2 | * Copyright (C) 2015 Canonical, Ltd. | ||
183 | 3 | * | ||
184 | 4 | * This program is free software; you can redistribute it and/or modify | ||
185 | 5 | * it under the terms of the GNU General Public License as published by | ||
186 | 6 | * the Free Software Foundation; version 3. | ||
187 | 7 | * | ||
188 | 8 | * This program is distributed in the hope that it will be useful, | ||
189 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
190 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
191 | 11 | * GNU General Public License for more details. | ||
192 | 12 | * | ||
193 | 13 | * You should have received a copy of the GNU General Public License | ||
194 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
195 | 15 | */ | ||
196 | 16 | |||
197 | 17 | import QtQuick 2.3 | ||
198 | 18 | import Ubuntu.Components 0.1 | ||
199 | 19 | |||
200 | 20 | Rectangle { | ||
201 | 21 | id: shimStage | ||
202 | 22 | |||
203 | 23 | anchors.fill: parent | ||
204 | 24 | color: UbuntuColors.lightAubergine | ||
205 | 25 | |||
206 | 26 | Text { | ||
207 | 27 | id: greeterModeText | ||
208 | 28 | |||
209 | 29 | anchors.horizontalCenter: parent.horizontalCenter | ||
210 | 30 | anchors.top: parent.top | ||
211 | 31 | anchors.topMargin: units.gu(10) | ||
212 | 32 | font.bold: true | ||
213 | 33 | horizontalAlignment: Text.AlignHCenter | ||
214 | 34 | text: "Shell is in \"greeter\" mode" | ||
215 | 35 | } | ||
216 | 36 | |||
217 | 37 | Text { | ||
218 | 38 | anchors.centerIn: parent | ||
219 | 39 | color: UbuntuColors.orange | ||
220 | 40 | font.pointSize: units.gu(8) | ||
221 | 41 | horizontalAlignment: Text.AlignHCenter | ||
222 | 42 | text: "Shim \nStage" | ||
223 | 43 | } | ||
224 | 44 | } | ||
225 | 0 | 45 | ||
226 | === modified file 'tests/autopilot/unity8/application_lifecycle/tests/__init__.py' | |||
227 | --- tests/autopilot/unity8/application_lifecycle/tests/__init__.py 2015-02-23 17:29:04 +0000 | |||
228 | +++ tests/autopilot/unity8/application_lifecycle/tests/__init__.py 2015-06-16 19:33:06 +0000 | |||
229 | @@ -31,8 +31,8 @@ | |||
230 | 31 | super().setUp() | 31 | super().setUp() |
231 | 32 | self._qml_mock_enabled = False | 32 | self._qml_mock_enabled = False |
232 | 33 | self._data_dirs_mock_enabled = False | 33 | self._data_dirs_mock_enabled = False |
235 | 34 | unity_proxy = self.launch_unity() | 34 | self.launch_unity() |
236 | 35 | process_helpers.unlock_unity(unity_proxy) | 35 | process_helpers.unlock_unity() |
237 | 36 | 36 | ||
238 | 37 | def create_test_application(self): | 37 | def create_test_application(self): |
239 | 38 | desktop_file_dict = fixture_setup.DEFAULT_DESKTOP_FILE_DICT | 38 | desktop_file_dict = fixture_setup.DEFAULT_DESKTOP_FILE_DICT |
240 | 39 | 39 | ||
241 | === modified file 'tests/autopilot/unity8/greeter/__init__.py' | |||
242 | --- tests/autopilot/unity8/greeter/__init__.py 2015-03-23 23:40:27 +0000 | |||
243 | +++ tests/autopilot/unity8/greeter/__init__.py 2015-06-16 19:33:06 +0000 | |||
244 | @@ -0,0 +1,52 @@ | |||
245 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
246 | 2 | # | ||
247 | 3 | # Unity Autopilot Test Suite | ||
248 | 4 | # Copyright (C) 2015 Canonical | ||
249 | 5 | # | ||
250 | 6 | # This program is free software: you can redistribute it and/or modify | ||
251 | 7 | # it under the terms of the GNU General Public License as published by | ||
252 | 8 | # the Free Software Foundation, either version 3 of the License, or | ||
253 | 9 | # (at your option) any later version. | ||
254 | 10 | # | ||
255 | 11 | # This program is distributed in the hope that it will be useful, | ||
256 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
257 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
258 | 14 | # GNU General Public License for more details. | ||
259 | 15 | # | ||
260 | 16 | # You should have received a copy of the GNU General Public License | ||
261 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
262 | 18 | # | ||
263 | 19 | |||
264 | 20 | import dbus | ||
265 | 21 | |||
266 | 22 | from autopilot.matchers import Eventually | ||
267 | 23 | from testtools.matchers import Equals | ||
268 | 24 | |||
269 | 25 | |||
270 | 26 | def hide_greeter_with_dbus(): | ||
271 | 27 | dbus_proxy = _get_greeter_dbus_proxy() | ||
272 | 28 | if _is_greeter_active(): | ||
273 | 29 | dbus_proxy.HideGreeter() | ||
274 | 30 | |||
275 | 31 | |||
276 | 32 | def show_greeter_with_dbus(): | ||
277 | 33 | dbus_proxy = _get_greeter_dbus_proxy() | ||
278 | 34 | if not _is_greeter_active(): | ||
279 | 35 | dbus_proxy.ShowGreeter() | ||
280 | 36 | |||
281 | 37 | |||
282 | 38 | def wait_for_greeter(): | ||
283 | 39 | Eventually(Equals(True), timeout=300).match(_is_greeter_active) | ||
284 | 40 | |||
285 | 41 | |||
286 | 42 | def _get_greeter_dbus_proxy(): | ||
287 | 43 | bus = dbus.SessionBus() | ||
288 | 44 | return bus.get_object('com.canonical.UnityGreeter', '/') | ||
289 | 45 | |||
290 | 46 | |||
291 | 47 | def _is_greeter_active(): | ||
292 | 48 | try: | ||
293 | 49 | dbus_proxy = _get_greeter_dbus_proxy() | ||
294 | 50 | return dbus_proxy.Get('com.canonical.UnityGreeter', 'IsActive') | ||
295 | 51 | except: | ||
296 | 52 | return False | ||
297 | 0 | 53 | ||
298 | === modified file 'tests/autopilot/unity8/indicators/tests/__init__.py' | |||
299 | --- tests/autopilot/unity8/indicators/tests/__init__.py 2015-05-11 14:36:03 +0000 | |||
300 | +++ tests/autopilot/unity8/indicators/tests/__init__.py 2015-06-16 19:33:06 +0000 | |||
301 | @@ -31,7 +31,7 @@ | |||
302 | 31 | def setUp(self): | 31 | def setUp(self): |
303 | 32 | super().setUp() | 32 | super().setUp() |
304 | 33 | self.unity_proxy = self.launch_unity() | 33 | self.unity_proxy = self.launch_unity() |
306 | 34 | process_helpers.unlock_unity(self.unity_proxy) | 34 | process_helpers.unlock_unity() |
307 | 35 | 35 | ||
308 | 36 | 36 | ||
309 | 37 | class DeviceIndicatorTestCase(IndicatorTestCase): | 37 | class DeviceIndicatorTestCase(IndicatorTestCase): |
310 | 38 | 38 | ||
311 | === modified file 'tests/autopilot/unity8/process_helpers.py' | |||
312 | --- tests/autopilot/unity8/process_helpers.py 2015-05-11 14:36:03 +0000 | |||
313 | +++ tests/autopilot/unity8/process_helpers.py 2015-06-16 19:33:06 +0000 | |||
314 | @@ -19,14 +19,11 @@ | |||
315 | 19 | 19 | ||
316 | 20 | import logging | 20 | import logging |
317 | 21 | import subprocess | 21 | import subprocess |
318 | 22 | import dbus | ||
319 | 23 | 22 | ||
320 | 24 | import ubuntuuitoolkit | 23 | import ubuntuuitoolkit |
321 | 25 | from autopilot.exceptions import ProcessSearchError | ||
322 | 26 | from autopilot.introspection import get_proxy_object_for_existing_process | 24 | from autopilot.introspection import get_proxy_object_for_existing_process |
323 | 27 | 25 | ||
326 | 28 | from unity8.shell import emulators | 26 | from unity8 import greeter |
325 | 29 | from unity8.shell.emulators import main_window as main_window_emulator | ||
327 | 30 | 27 | ||
328 | 31 | logger = logging.getLogger(__name__) | 28 | logger = logging.getLogger(__name__) |
329 | 32 | 29 | ||
330 | @@ -39,104 +36,20 @@ | |||
331 | 39 | pass | 36 | pass |
332 | 40 | 37 | ||
333 | 41 | 38 | ||
335 | 42 | def unlock_unity(unity_proxy_obj=None): | 39 | def unlock_unity(): |
336 | 43 | """Helper function that attempts to unlock the unity greeter. | 40 | """Helper function that attempts to unlock the unity greeter. |
337 | 44 | 41 | ||
338 | 45 | If unity_proxy_object is None create a proxy object by querying for the | ||
339 | 46 | running unity process. | ||
340 | 47 | Otherwise re-use the passed proxy object. | ||
341 | 48 | |||
342 | 49 | :raises RuntimeError: if the greeter attempts and fails to be unlocked. | ||
343 | 50 | |||
344 | 51 | :raises RuntimeWarning: when the greeter cannot be found because it is | ||
345 | 52 | already unlocked. | ||
346 | 53 | :raises CannotAccessUnity: if unity is not introspectable or cannot be | ||
347 | 54 | found on dbus. | ||
348 | 55 | :raises CannotAccessUnity: if unity's upstart status is not "start" or the | ||
349 | 56 | upstart job cannot be found at all. | ||
350 | 57 | |||
351 | 58 | """ | 42 | """ |
386 | 59 | if unity_proxy_obj is None: | 43 | greeter.wait_for_greeter() |
387 | 60 | try: | 44 | greeter.hide_greeter_with_dbus() |
388 | 61 | pid = get_unity_pid() | 45 | |
389 | 62 | unity = _get_unity_proxy_object(pid) | 46 | |
390 | 63 | main_window = unity.select_single(main_window_emulator.QQuickView) | 47 | def lock_unity(): |
357 | 64 | except ProcessSearchError as e: | ||
358 | 65 | raise CannotAccessUnity( | ||
359 | 66 | "Cannot introspect unity, make sure that it has been started " | ||
360 | 67 | "with testability. Perhaps use the function " | ||
361 | 68 | "'restart_unity_with_testability' this module provides." | ||
362 | 69 | "(%s)" | ||
363 | 70 | % str(e) | ||
364 | 71 | ) | ||
365 | 72 | else: | ||
366 | 73 | main_window = unity_proxy_obj.select_single( | ||
367 | 74 | main_window_emulator.QQuickView) | ||
368 | 75 | |||
369 | 76 | greeter = main_window.get_greeter() | ||
370 | 77 | if greeter.created is False: | ||
371 | 78 | raise RuntimeWarning("Greeter appears to be already unlocked.") | ||
372 | 79 | |||
373 | 80 | bus = dbus.SessionBus() | ||
374 | 81 | dbus_proxy = bus.get_object("com.canonical.UnityGreeter", "/") | ||
375 | 82 | try: | ||
376 | 83 | dbus_proxy.HideGreeter() | ||
377 | 84 | except dbus.DBusException: | ||
378 | 85 | logger.info("Failed to unlock greeter") | ||
379 | 86 | raise | ||
380 | 87 | else: | ||
381 | 88 | greeter.created.wait_for(False) | ||
382 | 89 | logger.info("Greeter unlocked, continuing.") | ||
383 | 90 | |||
384 | 91 | |||
385 | 92 | def lock_unity(unity_proxy_obj=None): | ||
391 | 93 | """Helper function that attempts to lock unity greeter. | 48 | """Helper function that attempts to lock unity greeter. |
392 | 94 | 49 | ||
393 | 95 | If unity_proxy_object is None create a proxy object by querying for the | ||
394 | 96 | running unity process. | ||
395 | 97 | Otherwise re-use the passed proxy object. | ||
396 | 98 | |||
397 | 99 | :raises RuntimeError: if the greeter attempts and fails to be locked. | ||
398 | 100 | |||
399 | 101 | :raises RuntimeWarning: when the greeter is found because it is | ||
400 | 102 | already locked. | ||
401 | 103 | :raises CannotAccessUnity: if unity is not introspectable or cannot be | ||
402 | 104 | found on dbus. | ||
403 | 105 | :raises CannotAccessUnity: if unity's upstart status is not "start" or the | ||
404 | 106 | upstart job cannot be found at all. | ||
405 | 107 | |||
406 | 108 | """ | 50 | """ |
438 | 109 | if unity_proxy_obj is None: | 51 | greeter.show_greeter_with_dbus() |
439 | 110 | try: | 52 | greeter.wait_for_greeter() |
409 | 111 | pid = get_unity_pid() | ||
410 | 112 | unity = _get_unity_proxy_object(pid) | ||
411 | 113 | main_window = unity.select_single(main_window_emulator.QQuickView) | ||
412 | 114 | except ProcessSearchError as e: | ||
413 | 115 | raise CannotAccessUnity( | ||
414 | 116 | "Cannot introspect unity, make sure that it has been started " | ||
415 | 117 | "with testability. Perhaps use the function " | ||
416 | 118 | "'restart_unity_with_testability' this module provides." | ||
417 | 119 | "(%s)" | ||
418 | 120 | % str(e) | ||
419 | 121 | ) | ||
420 | 122 | else: | ||
421 | 123 | main_window = unity_proxy_obj.select_single( | ||
422 | 124 | main_window_emulator.QQuickView) | ||
423 | 125 | |||
424 | 126 | greeter = main_window.get_greeter() | ||
425 | 127 | if greeter.created is True: | ||
426 | 128 | raise RuntimeWarning("Greeter appears to be already locked.") | ||
427 | 129 | |||
428 | 130 | bus = dbus.SessionBus() | ||
429 | 131 | dbus_proxy = bus.get_object("com.canonical.UnityGreeter", "/") | ||
430 | 132 | try: | ||
431 | 133 | dbus_proxy.ShowGreeter() | ||
432 | 134 | except dbus.DBusException: | ||
433 | 135 | logger.info("Failed to lock greeter") | ||
434 | 136 | raise | ||
435 | 137 | else: | ||
436 | 138 | greeter.created.wait_for(True) | ||
437 | 139 | logger.info("Greeter locked, continuing.") | ||
440 | 140 | 53 | ||
441 | 141 | 54 | ||
442 | 142 | def restart_unity_with_testability(*args): | 55 | def restart_unity_with_testability(*args): |
443 | 143 | 56 | ||
444 | === modified file 'tests/autopilot/unity8/shell/tests/test_emulators.py' | |||
445 | --- tests/autopilot/unity8/shell/tests/test_emulators.py 2015-04-17 21:58:16 +0000 | |||
446 | +++ tests/autopilot/unity8/shell/tests/test_emulators.py 2015-06-16 19:33:06 +0000 | |||
447 | @@ -41,8 +41,8 @@ | |||
448 | 41 | 41 | ||
449 | 42 | def setUp(self): | 42 | def setUp(self): |
450 | 43 | super().setUp() | 43 | super().setUp() |
453 | 44 | unity_proxy = self.launch_unity() | 44 | self.launch_unity() |
454 | 45 | process_helpers.unlock_unity(unity_proxy) | 45 | process_helpers.unlock_unity() |
455 | 46 | 46 | ||
456 | 47 | 47 | ||
457 | 48 | class DashEmulatorTestCase(tests.DashBaseTestCase): | 48 | class DashEmulatorTestCase(tests.DashBaseTestCase): |
458 | 49 | 49 | ||
459 | === modified file 'tests/autopilot/unity8/shell/tests/test_notifications.py' | |||
460 | --- tests/autopilot/unity8/shell/tests/test_notifications.py 2015-04-17 21:58:16 +0000 | |||
461 | +++ tests/autopilot/unity8/shell/tests/test_notifications.py 2015-06-16 19:33:06 +0000 | |||
462 | @@ -119,8 +119,8 @@ | |||
463 | 119 | 119 | ||
464 | 120 | def test_interactive(self): | 120 | def test_interactive(self): |
465 | 121 | """Interactive notification must react upon click on itself.""" | 121 | """Interactive notification must react upon click on itself.""" |
468 | 122 | unity_proxy = self.launch_unity() | 122 | self.launch_unity() |
469 | 123 | unlock_unity(unity_proxy) | 123 | unlock_unity() |
470 | 124 | 124 | ||
471 | 125 | notify_list = self._get_notifications_list() | 125 | notify_list = self._get_notifications_list() |
472 | 126 | 126 | ||
473 | @@ -156,8 +156,8 @@ | |||
474 | 156 | """Snap-decision with three actions should use | 156 | """Snap-decision with three actions should use |
475 | 157 | one-over two button layout. | 157 | one-over two button layout. |
476 | 158 | """ | 158 | """ |
479 | 159 | unity_proxy = self.launch_unity() | 159 | self.launch_unity() |
480 | 160 | unlock_unity(unity_proxy) | 160 | unlock_unity() |
481 | 161 | 161 | ||
482 | 162 | summary = "Theatre at Ferria Stadium" | 162 | summary = "Theatre at Ferria Stadium" |
483 | 163 | body = "at Ferria Stadium in Bilbao, Spain\n07578545317" | 163 | body = "at Ferria Stadium in Bilbao, Spain\n07578545317" |
484 | @@ -197,8 +197,8 @@ | |||
485 | 197 | """Snap-decision should block input to shell | 197 | """Snap-decision should block input to shell |
486 | 198 | without greeter/lockscreen. | 198 | without greeter/lockscreen. |
487 | 199 | """ | 199 | """ |
490 | 200 | unity_proxy = self.launch_unity() | 200 | self.launch_unity() |
491 | 201 | unlock_unity(unity_proxy) | 201 | unlock_unity() |
492 | 202 | 202 | ||
493 | 203 | summary = "Incoming file" | 203 | summary = "Incoming file" |
494 | 204 | body = "Frank would like to send you the file: essay.pdf" | 204 | body = "Frank would like to send you the file: essay.pdf" |
495 | @@ -421,8 +421,8 @@ | |||
496 | 421 | 421 | ||
497 | 422 | def test_icon_summary_body(self): | 422 | def test_icon_summary_body(self): |
498 | 423 | """Notification must display the expected summary and body text.""" | 423 | """Notification must display the expected summary and body text.""" |
501 | 424 | unity_proxy = self.launch_unity() | 424 | self.launch_unity() |
502 | 425 | unlock_unity(unity_proxy) | 425 | unlock_unity() |
503 | 426 | 426 | ||
504 | 427 | notify_list = self._get_notifications_list() | 427 | notify_list = self._get_notifications_list() |
505 | 428 | 428 | ||
506 | @@ -458,8 +458,8 @@ | |||
507 | 458 | def test_icon_summary(self): | 458 | def test_icon_summary(self): |
508 | 459 | """Notification must display the expected summary and secondary | 459 | """Notification must display the expected summary and secondary |
509 | 460 | icon.""" | 460 | icon.""" |
512 | 461 | unity_proxy = self.launch_unity() | 461 | self.launch_unity() |
513 | 462 | unlock_unity(unity_proxy) | 462 | unlock_unity() |
514 | 463 | 463 | ||
515 | 464 | notify_list = self._get_notifications_list() | 464 | notify_list = self._get_notifications_list() |
516 | 465 | 465 | ||
517 | @@ -491,8 +491,8 @@ | |||
518 | 491 | def test_urgency_order(self): | 491 | def test_urgency_order(self): |
519 | 492 | """Notifications must be displayed in order according to their | 492 | """Notifications must be displayed in order according to their |
520 | 493 | urgency.""" | 493 | urgency.""" |
523 | 494 | unity_proxy = self.launch_unity() | 494 | self.launch_unity() |
524 | 495 | unlock_unity(unity_proxy) | 495 | unlock_unity() |
525 | 496 | 496 | ||
526 | 497 | notify_list = self._get_notifications_list() | 497 | notify_list = self._get_notifications_list() |
527 | 498 | 498 | ||
528 | @@ -578,8 +578,8 @@ | |||
529 | 578 | 578 | ||
530 | 579 | def test_summary_and_body(self): | 579 | def test_summary_and_body(self): |
531 | 580 | """Notification must display the expected summary- and body-text.""" | 580 | """Notification must display the expected summary- and body-text.""" |
534 | 581 | unity_proxy = self.launch_unity() | 581 | self.launch_unity() |
535 | 582 | unlock_unity(unity_proxy) | 582 | unlock_unity() |
536 | 583 | 583 | ||
537 | 584 | notify_list = self._get_notifications_list() | 584 | notify_list = self._get_notifications_list() |
538 | 585 | 585 | ||
539 | @@ -603,8 +603,8 @@ | |||
540 | 603 | 603 | ||
541 | 604 | def test_summary_only(self): | 604 | def test_summary_only(self): |
542 | 605 | """Notification must display only the expected summary-text.""" | 605 | """Notification must display only the expected summary-text.""" |
545 | 606 | unity_proxy = self.launch_unity() | 606 | self.launch_unity() |
546 | 607 | unlock_unity(unity_proxy) | 607 | unlock_unity() |
547 | 608 | 608 | ||
548 | 609 | notify_list = self._get_notifications_list() | 609 | notify_list = self._get_notifications_list() |
549 | 610 | 610 | ||
550 | @@ -621,8 +621,8 @@ | |||
551 | 621 | def test_update_notification_same_layout(self): | 621 | def test_update_notification_same_layout(self): |
552 | 622 | """Notification must allow updating its contents while being | 622 | """Notification must allow updating its contents while being |
553 | 623 | displayed.""" | 623 | displayed.""" |
556 | 624 | unity_proxy = self.launch_unity() | 624 | self.launch_unity() |
557 | 625 | unlock_unity(unity_proxy) | 625 | unlock_unity() |
558 | 626 | 626 | ||
559 | 627 | notify_list = self._get_notifications_list() | 627 | notify_list = self._get_notifications_list() |
560 | 628 | 628 | ||
561 | @@ -660,8 +660,8 @@ | |||
562 | 660 | def test_update_notification_layout_change(self): | 660 | def test_update_notification_layout_change(self): |
563 | 661 | """Notification must allow updating its contents and layout while | 661 | """Notification must allow updating its contents and layout while |
564 | 662 | being displayed.""" | 662 | being displayed.""" |
567 | 663 | unity_proxy = self.launch_unity() | 663 | self.launch_unity() |
568 | 664 | unlock_unity(unity_proxy) | 664 | unlock_unity() |
569 | 665 | 665 | ||
570 | 666 | notify_list = self._get_notifications_list() | 666 | notify_list = self._get_notifications_list() |
571 | 667 | 667 | ||
572 | @@ -709,8 +709,8 @@ | |||
573 | 709 | """ use the create notification script to get a notification dialog. | 709 | """ use the create notification script to get a notification dialog. |
574 | 710 | Check that the arguments passed to the script match the fields. """ | 710 | Check that the arguments passed to the script match the fields. """ |
575 | 711 | 711 | ||
578 | 712 | unity_proxy = self.launch_unity() | 712 | self.launch_unity() |
579 | 713 | unlock_unity(unity_proxy) | 713 | unlock_unity() |
580 | 714 | 714 | ||
581 | 715 | summary = 'Helper summary' | 715 | summary = 'Helper summary' |
582 | 716 | body = 'Helper body' | 716 | body = 'Helper body' |
583 | 717 | 717 | ||
584 | === modified file 'tests/qmltests/Tutorial/tst_Tutorial.qml' | |||
585 | --- tests/qmltests/Tutorial/tst_Tutorial.qml 2015-05-18 23:04:12 +0000 | |||
586 | +++ tests/qmltests/Tutorial/tst_Tutorial.qml 2015-06-16 19:33:06 +0000 | |||
587 | @@ -73,6 +73,7 @@ | |||
588 | 73 | sourceComponent: Component { | 73 | sourceComponent: Component { |
589 | 74 | Shell { | 74 | Shell { |
590 | 75 | property string indicatorProfile: "phone" | 75 | property string indicatorProfile: "phone" |
591 | 76 | property string shellMode: "full-greeter" /* default */ | ||
592 | 76 | 77 | ||
593 | 77 | Component.onDestruction: { | 78 | Component.onDestruction: { |
594 | 78 | shellLoader.itemDestroyed = true; | 79 | shellLoader.itemDestroyed = true; |
595 | 79 | 80 | ||
596 | === modified file 'tests/qmltests/tst_Shell.qml' | |||
597 | --- tests/qmltests/tst_Shell.qml 2015-06-12 16:07:43 +0000 | |||
598 | +++ tests/qmltests/tst_Shell.qml 2015-06-16 19:33:06 +0000 | |||
599 | @@ -81,6 +81,8 @@ | |||
600 | 81 | property bool itemDestroyed: false | 81 | property bool itemDestroyed: false |
601 | 82 | sourceComponent: Component { | 82 | sourceComponent: Component { |
602 | 83 | Shell { | 83 | Shell { |
603 | 84 | property string shellMode: "full-greeter" /* default */ | ||
604 | 85 | |||
605 | 84 | usageScenario: "phone" | 86 | usageScenario: "phone" |
606 | 85 | orientation: Qt.PortraitOrientation | 87 | orientation: Qt.PortraitOrientation |
607 | 86 | primaryOrientation: Qt.PortraitOrientation | 88 | primaryOrientation: Qt.PortraitOrientation |
608 | 87 | 89 | ||
609 | === modified file 'tests/qmltests/tst_ShellWithPin.qml' | |||
610 | --- tests/qmltests/tst_ShellWithPin.qml 2015-05-11 14:36:03 +0000 | |||
611 | +++ tests/qmltests/tst_ShellWithPin.qml 2015-06-16 19:33:06 +0000 | |||
612 | @@ -69,6 +69,8 @@ | |||
613 | 69 | property bool itemDestroyed: false | 69 | property bool itemDestroyed: false |
614 | 70 | sourceComponent: Component { | 70 | sourceComponent: Component { |
615 | 71 | Shell { | 71 | Shell { |
616 | 72 | property string shellMode: "full-greeter" /* default */ | ||
617 | 73 | |||
618 | 72 | Component.onDestruction: { | 74 | Component.onDestruction: { |
619 | 73 | shellLoader.itemDestroyed = true | 75 | shellLoader.itemDestroyed = true |
620 | 74 | } | 76 | } |
FAILED: Continuous integration, rev:1760 jenkins. qa.ubuntu. com/job/ unity8- ci/5681/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 2648 jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- vivid/846 jenkins. qa.ubuntu. com/job/ unity8- vivid-amd64- ci/846 jenkins. qa.ubuntu. com/job/ unity8- vivid-i386- ci/846 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-mako/ 2289 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 2646 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 2646/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 20233
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/5681/ rebuild
http://