Merge lp:~dandrader/unity8/stabilizeShellTest into lp:unity8

Proposed by Daniel d'Andrada on 2015-02-25
Status: Merged
Approved by: Albert Astals Cid on 2015-02-26
Approved revision: 1637
Merged at revision: 1649
Proposed branch: lp:~dandrader/unity8/stabilizeShellTest
Merge into: lp:unity8
Diff against target: 88 lines (+31/-13)
1 file modified
tests/qmltests/tst_Shell.qml (+31/-13)
To merge this branch: bzr merge lp:~dandrader/unity8/stabilizeShellTest
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-02-25
Albert Astals Cid (community) 2015-02-25 Approve on 2015-02-25
Review via email: mp+250920@code.launchpad.net

Commit Message

Stabilize some Shell qml tests

As they might fail if the test runs too fast.

I also did some coding style fixes along the way (added some missing ";") and updated/refactored test_login to reflect what happens currently.

Description of the Change

I also did some coding style fixes along the way (added some missing ";").

* 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?
Not applicable

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

Looks good to me and tests still pass for me, but let's wait for top approval and make sure still pass on CI too

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

 * Did CI run pass?
Waiting

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve
1637. By Daniel d'Andrada on 2015-02-25

Update tst_login and add a helper showLogin() function

Albert Astals Cid (aacid) wrote :

Still looks good, next wait for CI run over 1637

review: Approve

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-02-23 15:43:41 +0000
3+++ tests/qmltests/tst_Shell.qml 2015-02-25 14:38:52 +0000
4@@ -317,8 +317,7 @@
5
6 var greeter = findChild(shell, "greeter");
7 if (data.greeterShown) {
8- LightDM.Greeter.showGreeter();
9- tryCompare(greeter, "fullyShown", true);
10+ showGreeter();
11 }
12
13 if (data.revealLauncher) {
14@@ -375,7 +374,15 @@
15 tryCompare(greeter, "fullyShown", true);
16
17 // Swipe away greeter to focus app
18+
19+ // greeter unloads its internal components when hidden
20+ // and reloads them when shown. Thus we have to do this
21+ // again before interacting with it otherwise any
22+ // DirectionalDragAreas in there won't be easily fooled by
23+ // fake swipes.
24+ removeTimeConstraintsFromDirectionalDragAreas(greeter);
25 swipeAwayGreeter();
26+
27 tryCompare(ApplicationManager, "suspended", false);
28 compare(mainApp.state, ApplicationInfoInterface.Running);
29 tryCompare(ApplicationManager, "focusedApplicationId", mainAppId);
30@@ -593,11 +600,25 @@
31 && itemRectInShell.y + itemRectInShell.height <= shell.height;
32 }
33
34+ function showGreeter() {
35+ var greeter = findChild(shell, "greeter");
36+ LightDM.Greeter.showGreeter();
37+ waitForRendering(greeter);
38+ tryCompare(greeter, "fullyShown", true);
39+
40+ // greeter unloads its internal components when hidden
41+ // and reloads them when shown. Thus we have to do this
42+ // again before interacting with it otherwise any
43+ // DirectionalDragAreas in there won't be easily fooled by
44+ // fake swipes.
45+ removeTimeConstraintsFromDirectionalDragAreas(greeter);
46+ }
47+
48 function test_greeterDoesNotChangeIndicatorProfile() {
49 var panel = findChild(shell, "panel");
50 tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
51
52- LightDM.Greeter.showGreeter();
53+ showGreeter();
54 tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
55
56 LightDM.Greeter.hideGreeter();
57@@ -632,8 +653,7 @@
58
59 waitUntilDashIsFocused();
60
61- LightDM.Greeter.showGreeter();
62- tryCompare(greeter, "fullyShown", true);
63+ showGreeter();
64
65 // The main point of this test
66 ApplicationManager.requestFocusApplication("dialer-app");
67@@ -664,15 +684,13 @@
68 tryCompare(greeter, "shown", false)
69 }
70
71- function test_login() {
72- var greeter = findChild(shell, "greeter")
73- waitForRendering(greeter)
74- LightDM.Greeter.showGreeter();
75- tryCompare(greeter, "fullyShown", true)
76-
77+ function test_greeterLoginsAutomaticallyWhenNoPasswordSet() {
78 sessionSpy.clear();
79- swipeAwayGreeter()
80- tryCompare(sessionSpy, "count", 1)
81+ verify(sessionSpy.valid);
82+
83+ showGreeter();
84+
85+ tryCompare(sessionSpy, "count", 1);
86 }
87
88 function test_fullscreen() {

Subscribers

People subscribed via source and target branches