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

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1595
Merged at revision: 1601
Proposed branch: lp:~dandrader/unity8/improveLauncherTests
Merge into: lp:unity8
Prerequisite: lp:~mzanetti/unity8/launcher-fixes
Diff against target: 112 lines (+33/-20)
1 file modified
tests/qmltests/Launcher/tst_Launcher.qml (+33/-20)
To merge this branch: bzr merge lp:~dandrader/unity8/improveLauncherTests
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+248919@code.launchpad.net

Commit message

Improve Launcher tests, making them more reliable

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
lp:~mzanetti/unity8/launcher-fixes

 * 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.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
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.

hell yeah!

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

yip yip

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
--- tests/qmltests/Launcher/tst_Launcher.qml 2015-02-06 14:48:22 +0000
+++ tests/qmltests/Launcher/tst_Launcher.qml 2015-02-06 14:48:22 +0000
@@ -153,6 +153,18 @@
153 tryCompare(panel, "x", -panel.width, 1000);153 tryCompare(panel, "x", -panel.width, 1000);
154 }154 }
155155
156 function positionLauncherListAtBeginning() {
157 var listView = testCase.findChild(launcherLoader.item, "launcherListView");
158 listView.contentY = -listView.topMargin;
159 }
160 function positionLauncherListAtEnd() {
161 var listView = testCase.findChild(launcherLoader.item, "launcherListView");
162 if ((listView.contentHeight + listView.topMargin + listView.bottomMargin) > listView.height) {
163 listView.contentY = listView.topMargin + listView.contentHeight
164 - listView.height;
165 }
166 }
167
156 // Drag from the left edge of the screen rightwards and check that the launcher168 // Drag from the left edge of the screen rightwards and check that the launcher
157 // appears (as if being dragged by the finger/pointer)169 // appears (as if being dragged by the finger/pointer)
158 function test_dragLeftEdgeToRevealLauncherAndTapCenterToDismiss() {170 function test_dragLeftEdgeToRevealLauncherAndTapCenterToDismiss() {
@@ -179,22 +191,22 @@
179 launcherApplicationSelected("[...]dialer-app.desktop") */191 launcherApplicationSelected("[...]dialer-app.desktop") */
180 function test_clickingOnAppIconCausesSignalEmission() {192 function test_clickingOnAppIconCausesSignalEmission() {
181 dragLauncherIntoView();193 dragLauncherIntoView();
182 launcher.lastSelectedApplication = ""194 launcher.lastSelectedApplication = "";
183195 launcher.inverted = false;
184 var listView = findChild(launcher, "launcherListView");196
185 listView.positionViewAtEnd();197 positionLauncherListAtBeginning();
186198
187 var appIcon = findChild(launcher, "launcherDelegate0")199 var appIcon = findChild(launcher, "launcherDelegate0");
188200
189 verify(appIcon != undefined)201 verify(appIcon != undefined);
190202
191 mouseClick(appIcon)203 mouseClick(appIcon);
192204
193 tryCompare(launcher, "lastSelectedApplication",205 tryCompare(launcher, "lastSelectedApplication",
194 "dialer-app")206 appIcon.appId);
195207
196 // Tapping on an application icon also dismisses the launcher208 // Tapping on an application icon also dismisses the launcher
197 waitUntilLauncherDisappears()209 waitUntilLauncherDisappears();
198 }210 }
199211
200 /* If I click on the dash icon on the launcher212 /* If I click on the dash icon on the launcher
@@ -290,25 +302,26 @@
290 function test_clickFlick_data() {302 function test_clickFlick_data() {
291 var listView = findChild(launcher, "launcherListView");303 var listView = findChild(launcher, "launcherListView");
292 return [304 return [
293 {tag: "unfolded top", positionViewAtBeginning: false,305 {tag: "unfolded top", positionViewAtBeginning: true,
294 clickY: listView.topMargin + units.gu(2),306 clickY: listView.topMargin + units.gu(2),
295 expectFlick: false},307 expectFlick: false},
296308
297 {tag: "folded top", positionViewAtBeginning: true,309 {tag: "folded top", positionViewAtBeginning: false,
298 clickY: listView.topMargin + units.gu(2),310 clickY: listView.topMargin + units.gu(2),
299 expectFlick: true},311 expectFlick: true},
300312
301 {tag: "unfolded bottom", positionViewAtBeginning: true,313 {tag: "unfolded bottom", positionViewAtBeginning: false,
302 clickY: listView.height - listView.topMargin - units.gu(1),314 clickY: listView.height - listView.topMargin - units.gu(1),
303 expectFlick: false},315 expectFlick: false},
304316
305 {tag: "folded bottom", positionViewAtBeginning: false,317 {tag: "folded bottom", positionViewAtBeginning: true,
306 clickY: listView.height - listView.topMargin - units.gu(1),318 clickY: listView.height - listView.topMargin - units.gu(1),
307 expectFlick: true},319 expectFlick: true},
308 ];320 ];
309 }321 }
310322
311 function test_clickFlick(data) {323 function test_clickFlick(data) {
324 launcher.inverted = false;
312 launcher.lastSelectedApplication = "";325 launcher.lastSelectedApplication = "";
313 dragLauncherIntoView();326 dragLauncherIntoView();
314 var listView = findChild(launcher, "launcherListView");327 var listView = findChild(launcher, "launcherListView");
@@ -318,9 +331,9 @@
318 // So for stability's sake we just put the listView in the position331 // So for stability's sake we just put the listView in the position
319 // we want to to actually start doing what this tests intends to check.332 // we want to to actually start doing what this tests intends to check.
320 if (data.positionViewAtBeginning) {333 if (data.positionViewAtBeginning) {
321 listView.positionViewAtBeginning();334 positionLauncherListAtBeginning();
322 } else {335 } else {
323 listView.positionViewAtEnd();336 positionLauncherListAtEnd();
324 }337 }
325 tryCompare(listView, "flicking", false);338 tryCompare(listView, "flicking", false);
326339
@@ -455,9 +468,9 @@
455 // Position launcher to where we need it468 // Position launcher to where we need it
456 var listView = findChild(launcher, "launcherListView");469 var listView = findChild(launcher, "launcherListView");
457 if (data.flickTo == "top") {470 if (data.flickTo == "top") {
458 listView.positionViewAtEnd();471 positionLauncherListAtBeginning();
459 } else {472 } else {
460 listView.positionViewAtBeginning();473 positionLauncherListAtEnd();
461 }474 }
462475
463 // Doing longpress476 // Doing longpress

Subscribers

People subscribed via source and target branches