Merge lp:~aacid/unity8/mouseClickMiddle into lp:unity8

Proposed by Albert Astals Cid on 2015-01-09
Status: Merged
Approved by: Michał Sawicz on 2015-01-09
Approved revision: 1526
Merged at revision: 1542
Proposed branch: lp:~aacid/unity8/mouseClickMiddle
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/proper_back_button
Diff against target: 1302 lines (+211/-150)
28 files modified
tests/qmltests/Components/tst_Carousel.qml (+5/-5)
tests/qmltests/Components/tst_Lockscreen.qml (+1/-1)
tests/qmltests/Dash/Previews/tst_PreviewActions.qml (+3/-3)
tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml (+5/-5)
tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml (+2/-2)
tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml (+6/-6)
tests/qmltests/Dash/Previews/tst_PreviewPayments.qml (+5/-5)
tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml (+1/-1)
tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml (+2/-2)
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml (+2/-2)
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingBoolean.qml (+2/-2)
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingNumber.qml (+3/-3)
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingString.qml (+2/-2)
tests/qmltests/Dash/tst_Card.qml (+2/-2)
tests/qmltests/Dash/tst_Dash.qml (+19/-19)
tests/qmltests/Dash/tst_DashContent.qml (+27/-27)
tests/qmltests/Dash/tst_GenericScopeView.qml (+32/-32)
tests/qmltests/Dash/tst_PageHeader.qml (+1/-1)
tests/qmltests/Dash/tst_PreviewListView.qml (+2/-2)
tests/qmltests/Launcher/tst_Launcher.qml (+8/-8)
tests/qmltests/Notifications/tst_Notifications.qml (+6/-6)
tests/qmltests/Notifications/tst_OptionToggle.qml (+7/-7)
tests/qmltests/Notifications/tst_SwipeToAct.qml (+1/-1)
tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml (+2/-2)
tests/qmltests/Panel/tst_IndicatorsBar.qml (+1/-1)
tests/qmltests/tst_Shell.qml (+2/-2)
tests/qmltests/tst_TabletShell.qml (+1/-1)
tests/utils/modules/Unity/Test/UnityTestCase.qml (+61/-0)
To merge this branch: bzr merge lp:~aacid/unity8/mouseClickMiddle
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-01-09
Michał Sawicz 2015-01-09 Approve on 2015-01-09
Review via email: mp+245932@code.launchpad.net

Commit Message

Test: By default mouseX act on the middle

Saves us lots of typing, tests are easier to read and workarounds problems that sometimes happen if we end up with 0, 0 as mouse coordinates because the precission of some geometry goes crazy and since we're clicking on 0x0 after lots transformations of pos into pos into pos we end up clicking outside the item by a very small number

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected?
Prerequisite

 * Did you perform an exploratory manual test run of your code change and any related functionality?
No, it's a test only change, tests are more stable now

 * 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?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
lp:~aacid/unity8/mouseClickMiddle updated on 2015-01-09
1527. By Albert Astals Cid on 2015-01-09

Somehow i lost this !

1528. By Albert Astals Cid on 2015-01-09

;

1529. By Albert Astals Cid on 2015-01-09

Wops

Michał Sawicz (saviq) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Y
 * Did CI run pass? If not, please explain why.
Not yet
 * Did you make sure that the branch does not contain spurious tags?
Y

review: Approve
lp:~aacid/unity8/mouseClickMiddle updated on 2015-01-09
1530. By Albert Astals Cid on 2015-01-09

===

1531. By Albert Astals Cid on 2015-01-09

Better clicks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/qmltests/Components/tst_Carousel.qml'
2--- tests/qmltests/Components/tst_Carousel.qml 2014-07-08 17:49:18 +0000
3+++ tests/qmltests/Components/tst_Carousel.qml 2015-01-09 10:25:35 +0000
4@@ -274,20 +274,20 @@
5
6 spy.signalName = "clicked";
7 spy.target = carouselItem;
8- mouseClick(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
9+ mouseClick(carouselItem);
10 tryCompare(carouselList, "moving", false);
11 tryCompare(carouselItem, "explicitlyScaled", true);
12- mouseClick(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
13+ mouseClick(carouselItem);
14 spy.wait();
15
16 spy.signalName = "pressAndHold";
17 spy.target = carouselItem;
18- mouseClick(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
19+ mouseClick(carouselItem);
20 tryCompare(carouselList, "moving", false);
21 tryCompare(carouselItem, "explicitlyScaled", true);
22- mousePress(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
23+ mousePress(carouselItem);
24 spy.wait();
25- mouseRelease(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
26+ mouseRelease(carouselItem);
27 }
28 }
29 }
30
31=== modified file 'tests/qmltests/Components/tst_Lockscreen.qml'
32--- tests/qmltests/Components/tst_Lockscreen.qml 2014-09-24 19:30:06 +0000
33+++ tests/qmltests/Components/tst_Lockscreen.qml 2015-01-09 10:25:35 +0000
34@@ -421,7 +421,7 @@
35 signalSpy.clear();
36
37 var okButton = findChild(root, "infoPopupOkButton");
38- mouseClick(okButton, okButton.width / 2, okButton.height / 2);
39+ mouseClick(okButton);
40
41 tryCompareFunction(function() { return findChild(root, "infoPopup") === null}, true);
42
43
44=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewActions.qml'
45--- tests/qmltests/Dash/Previews/tst_PreviewActions.qml 2014-08-14 12:01:03 +0000
46+++ tests/qmltests/Dash/Previews/tst_PreviewActions.qml 2015-01-09 10:25:35 +0000
47@@ -104,7 +104,7 @@
48 var button = findChild(root, "button" + id);
49 verify(button != null);
50 spy.target = target;
51- mouseClick(button, button.width / 2, button.height / 2);
52+ mouseClick(button);
53 compare(spy.count, 1);
54 compare(spy.signalArguments[0][0], target.widgetId);
55 compare(spy.signalArguments[0][1], id);
56@@ -137,11 +137,11 @@
57 var buttonColumn = findChild(root, "buttonColumn");
58 verify(button != null);
59 var twoActionsY = twoActions.y
60- mouseClick(button, button.width / 2, button.height / 2);
61+ mouseClick(button);
62 tryCompareFunction(function () { return twoActions.y <= twoActionsY; }, false);
63 tryCompare(buttonColumn, "height", buttonColumn.implicitHeight);
64 checkButtonPressSignal(buttonAndCombo, data.id, data.buttonNumber);
65- mouseClick(button, button.width / 2, button.height / 2);
66+ mouseClick(button);
67 tryCompare(twoActions, "y", twoActionsY);
68 }
69 }
70
71=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml'
72--- tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml 2014-02-05 11:11:21 +0000
73+++ tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml 2015-01-09 10:25:35 +0000
74@@ -131,7 +131,7 @@
75 compare(track2ProgressBar.visible, false);
76
77 // Playing track 0 should make progress bar 0 visible
78- mouseClick(track0PlayButton, track0PlayButton.width / 2, track0PlayButton.height / 2);
79+ mouseClick(track0PlayButton);
80
81 tryCompare(audio, "playbackState", Audio.PlayingState);
82 checkPlayerSource(0);
83@@ -141,18 +141,18 @@
84 tryCompare(track2ProgressBar, "visible", false);
85
86 // Clicking the button again should pause it. The progress bar should stay visible
87- mouseClick(track0PlayButton, track0PlayButton.width / 2, track0PlayButton.height / 2);
88+ mouseClick(track0PlayButton);
89 tryCompare(audio, "playbackState", Audio.PausedState);
90 checkPlayerSource(0);
91 tryCompare(track0ProgressBar, "visible", true);
92
93 // Continue playback
94- mouseClick(track0PlayButton, track0PlayButton.width / 2, track0PlayButton.height / 2);
95+ mouseClick(track0PlayButton);
96 tryCompare(audio, "playbackState", Audio.PlayingState);
97 checkPlayerSource(0);
98
99 // Playing track 1 should make progress bar 1 visible and hide progress bar 0 again
100- mouseClick(track1PlayButton, track1PlayButton.width / 2, track1PlayButton.height / 2);
101+ mouseClick(track1PlayButton);
102
103 tryCompare(audio, "playbackState", Audio.PlayingState);
104 checkPlayerSource(1);
105@@ -162,7 +162,7 @@
106 tryCompare(track2ProgressBar, "visible", false);
107
108 // Playing track 2 should make progress bar 1 visible and hide progress bar 0 again
109- mouseClick(track2PlayButton, track2PlayButton.width / 2, track2PlayButton.height / 2);
110+ mouseClick(track2PlayButton);
111
112 tryCompare(audio, "playbackState", Audio.PlayingState);
113 checkPlayerSource(2);
114
115=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml'
116--- tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml 2014-08-22 14:40:00 +0000
117+++ tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml 2015-01-09 10:25:35 +0000
118@@ -85,7 +85,7 @@
119
120 function test_expand_collapse() {
121 var expandButton = findChild(previewExpandable, "expandButton")
122- mouseClick(expandButton, expandButton.width / 2, expandButton.height / 2);
123+ mouseClick(expandButton);
124
125 var repeater = findChild(previewExpandable, "repeater")
126 compare(repeater.count, 4)
127@@ -99,7 +99,7 @@
128 compare (repeater.itemAt(2).expanded, true);
129 compare (repeater.itemAt(3).expanded, true);
130
131- mouseClick(expandButton, expandButton.width / 2, expandButton.height / 2);
132+ mouseClick(expandButton);
133
134 checkInitialState();
135 }
136
137=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml'
138--- tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml 2014-10-22 17:35:15 +0000
139+++ tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml 2015-01-09 10:25:35 +0000
140@@ -67,23 +67,23 @@
141
142 function test_overlayOpenClose() {
143 var image0 = findChild(imageGallery, "previewImage0");
144- mouseClick(image0, image0.width / 2, image0.height / 2);
145+ mouseClick(image0);
146 tryCompare(overlay, "visible", true);
147 tryCompare(overlay, "scale", 1.0);
148 tryCompare(overlayCloseButton, "visible", true);
149- mouseClick(overlayCloseButton, overlayCloseButton.width / 2, overlayCloseButton.height / 2);
150+ mouseClick(overlayCloseButton);
151 tryCompare(overlay, "visible", false);
152 }
153
154 function test_overlayShowHideHeader() {
155 var image0 = findChild(imageGallery, "previewImage0");
156- mouseClick(image0, image0.width / 2, image0.height / 2);
157+ mouseClick(image0);
158 tryCompare(overlay, "visible", true);
159 tryCompare(overlay, "scale", 1.0);
160 tryCompare(overlayCloseButton, "visible", true);
161- mouseClick(overlay, overlay.width / 2, overlay.height / 2);
162+ mouseClick(overlay);
163 tryCompare(overlayCloseButton, "visible", false);
164- mouseClick(overlay, overlay.width / 2, overlay.height / 2);
165+ mouseClick(overlay);
166 tryCompare(overlayCloseButton, "visible", true);
167 }
168
169@@ -97,7 +97,7 @@
170
171 function test_overlayOpenCorrectImage(data) {
172 var image = findChild(imageGallery, "previewImage" + data.index);
173- mouseClick(image, image.width / 2, image.height / 2);
174+ mouseClick(image);
175 tryCompare(overlay, "visible", true);
176 tryCompare(overlay, "scale", 1.0);
177 tryCompare(overlayListView, "currentIndex", data.index);
178
179=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewPayments.qml'
180--- tests/qmltests/Dash/Previews/tst_PreviewPayments.qml 2014-09-18 13:43:18 +0000
181+++ tests/qmltests/Dash/Previews/tst_PreviewPayments.qml 2015-01-09 10:25:35 +0000
182@@ -84,7 +84,7 @@
183 var button = findChild(previewPayments, "paymentButton");
184 verify(button, "Button not found.");
185
186- mouseClick(button, button.width / 2, button.height / 2);
187+ mouseClick(button);
188
189 paymentClient.process();
190 spy.wait();
191@@ -107,7 +107,7 @@
192 tryCompare(button, "visible", true);
193 tryCompare(button, "opacity", 1);
194
195- mouseClick(button, button.width / 2, button.height / 2);
196+ mouseClick(button);
197
198 paymentClient.process();
199 spy.wait();
200@@ -130,7 +130,7 @@
201 tryCompare(button, "visible", true);
202 tryCompare(button, "opacity", 1);
203
204- mouseClick(button, button.width / 2, button.height / 2);
205+ mouseClick(button);
206
207 tryCompare(progress, "visible", true);
208 tryCompare(progress, "opacity", 1);
209@@ -154,7 +154,7 @@
210 var button = findChild(previewPayments, "paymentButton");
211 verify(button, "Button not found.");
212
213- mouseClick(button, button.width / 2, button.height / 2);
214+ mouseClick(button);
215
216 paymentClient.process();
217 spy.wait();
218@@ -175,7 +175,7 @@
219 verify(button, "Button not found.");
220 verify(progress, "Progress not found.");
221
222- mouseClick(button, button.width / 2, button.height / 2);
223+ mouseClick(button);
224
225 tryCompare(progress, "visible", true);
226 tryCompare(progress, "opacity", 1);
227
228=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml'
229--- tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml 2014-07-04 07:42:00 +0000
230+++ tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml 2015-01-09 10:25:35 +0000
231@@ -118,7 +118,7 @@
232 compare(rating.value, reviewsModel1["reviews"][1]["rating"]);
233
234 // Tap on first star
235- mouseClick(rating, 0, 0);
236+ mouseClick(rating);
237 compare(rating.value, reviewsModel1["reviews"][1]["rating"]);
238 }
239 }
240
241=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml'
242--- tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml 2014-05-01 14:25:18 +0000
243+++ tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml 2015-01-09 10:25:35 +0000
244@@ -139,7 +139,7 @@
245 verify(reviewTextArea.visible === true);
246
247 reviewTextArea.text = data.inputText;
248- mouseClick(submitButton, submitButton.width / 2, submitButton.height / 2);
249+ mouseClick(submitButton);
250 switch (data.widgetData["required"]) {
251 case "rating": {
252 if (rating.visible === false || data.inputRating < 0) {
253@@ -187,7 +187,7 @@
254 if (data.inputRating > 0) rating.value = data.inputRating;
255 if (data.inputText !== "") {
256 reviewTextArea.text = data.inputText;
257- mouseClick(submitButton, submitButton.width / 2, submitButton.height / 2);
258+ mouseClick(submitButton);
259 }
260
261 compare(spy.count, 1);
262
263=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml'
264--- tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml 2014-10-22 17:35:15 +0000
265+++ tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml 2015-01-09 10:25:35 +0000
266@@ -72,11 +72,11 @@
267
268 function test_zoomableImageOpenClose() {
269 var overlayCloseButton = findChild(overlay, "overlayCloseButton");
270- mouseClick(lazyImage, lazyImage.width / 2, lazyImage.height / 2);
271+ mouseClick(lazyImage);
272 tryCompare(overlay, "visible", true);
273 tryCompare(overlay, "scale", 1.0);
274 tryCompare(overlayCloseButton, "visible", true);
275- mouseClick(overlayCloseButton, overlayCloseButton.width / 2, overlayCloseButton.height / 2);
276+ mouseClick(overlayCloseButton);
277 tryCompare(overlay, "visible", false);
278 }
279 }
280
281=== modified file 'tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingBoolean.qml'
282--- tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingBoolean.qml 2014-08-26 12:27:36 +0000
283+++ tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingBoolean.qml 2015-01-09 10:25:35 +0000
284@@ -49,12 +49,12 @@
285
286 function test_updated() {
287 var control = findChild(scopeSetting, "control");
288- mouseClick(control, control.width / 2, control.height / 2);
289+ mouseClick(control);
290 spy.wait();
291 compare(spy.signalArguments[0][0], false);
292
293 spy.clear();
294- mouseClick(scopeSetting, scopeSetting.width / 2, scopeSetting.height / 2);
295+ mouseClick(scopeSetting);
296 spy.wait();
297 compare(spy.signalArguments[0][0], true);
298 }
299
300=== modified file 'tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingNumber.qml'
301--- tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingNumber.qml 2014-08-26 12:27:36 +0000
302+++ tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingNumber.qml 2015-01-09 10:25:35 +0000
303@@ -57,7 +57,7 @@
304 }
305
306 function test_updated_on_unfocus() {
307- mouseClick(control, control.width / 2, control.height / 2);
308+ mouseClick(control);
309 control.selectAll();
310 control.cut();
311 control.insert(0, newNumber);
312@@ -67,7 +67,7 @@
313 }
314
315 function test_updated_on_accepted() {
316- mouseClick(control, control.width / 2, control.height / 2);
317+ mouseClick(control);
318 control.selectAll();
319 control.cut();
320 control.insert(0, newNumber);
321@@ -86,7 +86,7 @@
322 }
323
324 function test_unacceptable_input() {
325- mouseClick(control, control.width / 2, control.height / 2);
326+ mouseClick(control);
327 control.selectAll();
328 control.cut();
329 control.insert(0, "not valid");
330
331=== modified file 'tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingString.qml'
332--- tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingString.qml 2014-08-26 12:27:36 +0000
333+++ tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingString.qml 2015-01-09 10:25:35 +0000
334@@ -57,7 +57,7 @@
335 }
336
337 function test_updated_on_unfocus() {
338- mouseClick(control, control.width / 2, control.height / 2);
339+ mouseClick(control);
340 control.selectAll();
341 control.cut();
342 control.insert(0, newText);
343@@ -67,7 +67,7 @@
344 }
345
346 function test_updated_on_accepted() {
347- mouseClick(control, control.width / 2, control.height / 2);
348+ mouseClick(control);
349 control.selectAll();
350 control.cut();
351 control.insert(0, newText);
352
353=== modified file 'tests/qmltests/Dash/tst_Card.qml'
354--- tests/qmltests/Dash/tst_Card.qml 2014-11-05 08:37:55 +0000
355+++ tests/qmltests/Dash/tst_Card.qml 2015-01-09 10:25:35 +0000
356@@ -539,9 +539,9 @@
357 var touchdown = findChild(card, "touchdown");
358
359 compare(touchdown.visible, false);
360- mousePress(card, card.width/2, card.height/2);
361+ mousePress(card);
362 compare(touchdown.visible, true);
363- mouseRelease(card, card.width/2, card.height/2);
364+ mouseRelease(card);
365 compare(touchdown.visible, false);
366 }
367
368
369=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
370--- tests/qmltests/Dash/tst_Dash.qml 2015-01-09 10:25:35 +0000
371+++ tests/qmltests/Dash/tst_Dash.qml 2015-01-09 10:25:35 +0000
372@@ -90,7 +90,7 @@
373 var scopesList = findChild(dash, "scopesList");
374 var scopesListPageHeader = findChild(scopesList, "pageHeader");
375 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
376- mouseClick(backButton, 0, 0);
377+ mouseClick(backButton);
378 tryCompare(bottomEdgeController, "progress", 0);
379 }
380
381@@ -106,7 +106,7 @@
382 tryCompare(favScopesListCategoryList, "currentIndex", 0);
383
384 // Click in first item
385- mouseClick(favScopesListCategoryList.currentItem, 0, 0);
386+ mouseClick(favScopesListCategoryList.currentItem);
387
388 // Make sure animation went back
389 tryCompare(bottomEdgeController, "progress", 0);
390@@ -128,7 +128,7 @@
391
392 // Click in second item
393 favScopesListCategoryList.currentIndex = 1;
394- mouseClick(favScopesListCategoryList.currentItem, 0, 0);
395+ mouseClick(favScopesListCategoryList.currentItem);
396
397 // Make sure animation went back
398 tryCompare(bottomEdgeController, "progress", 0);
399@@ -148,7 +148,7 @@
400 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
401
402 // Click on a non favorite scope
403- mouseClick(nonfavScopesListCategoryList.currentItem, 0, 0);
404+ mouseClick(nonfavScopesListCategoryList.currentItem);
405
406 // Check the bottom edge (manage dash) is disabled from temp scope
407 var overviewDragHandle = findChild(dash, "overviewDragHandle");
408@@ -165,7 +165,7 @@
409 // Go back
410 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
411 var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
412- mouseClick(backButton, 0, 0);
413+ mouseClick(backButton);
414
415 // Check temp scope is gone
416 tryCompare(dashTempScopeItem, "x", dash.width);
417@@ -189,7 +189,7 @@
418 var scopesList = findChild(dash, "scopesList");
419 var scopesListPageHeader = findChild(scopesList, "pageHeader");
420 var searchButton = findChild(scopesListPageHeader, "search_header_button");
421- mouseClick(searchButton, 0, 0);
422+ mouseClick(searchButton);
423
424 // Type something
425 keyClick(Qt.Key_H);
426@@ -201,7 +201,7 @@
427 var cardTempScope = findChild(dashCategorysearchA, "delegate2");
428
429 waitForRendering(cardTempScope);
430- mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
431+ mouseClick(cardTempScope);
432
433 // Check the bottom edge (overview) is disabled from temp scope
434 var overviewDragHandle = findChild(dash, "overviewDragHandle");
435@@ -218,7 +218,7 @@
436 // Go back
437 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
438 var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
439- mouseClick(backButton, 0, 0);
440+ mouseClick(backButton);
441
442 // Check temp scope is gone
443 tryCompare(dashTempScopeItem, "x", dash.width);
444@@ -244,7 +244,7 @@
445 var scopesList = findChild(dash, "scopesList");
446 var scopesListPageHeader = findChild(scopesList, "pageHeader");
447 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
448- mouseClick(backButton, 0, 0);
449+ mouseClick(backButton);
450 tryCompare(bottomEdgeController, "progress", 0);
451 }
452
453@@ -272,7 +272,7 @@
454 var scopeLoader0 = findChild(dashContent, "scopeLoader0");
455 var dashCategory0 = findChild(scopeLoader0, "dashCategory0");
456 var delegate0 = findChild(dashCategory0, "delegate0");
457- mouseClick(delegate0, delegate0.width / 2, delegate0.height / 2);
458+ mouseClick(delegate0);
459
460 tryCompare(dashContent, "subPageShown", true)
461 waitForRendering(dash);
462@@ -320,7 +320,7 @@
463 // Click on the store
464 var scopesListPageHeader = findChild(scopesList, "pageHeader");
465 var searchButton = findChild(scopesListPageHeader, "store_header_button");
466- mouseClick(searchButton, 0, 0);
467+ mouseClick(searchButton);
468
469 spy.wait();
470 compare(spy.signalArguments[0][0], "scope://com.canonical.scopes.clickstore");
471@@ -345,9 +345,9 @@
472 // Enter edit mode
473 var scopesList = findChild(dash, "scopesList");
474 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
475- mousePress(clickScope, 0, 0);
476+ mousePress(clickScope);
477 tryCompare(scopesList, "state", "edit");
478- mouseRelease(clickScope, 0, 0);
479+ mouseRelease(clickScope);
480
481 var starArea = findChild(clickScope, "starArea");
482 touchFlick(starArea, 0, 0, 0, -units.gu(10));
483@@ -356,8 +356,8 @@
484 var scopesList = findChild(dash, "scopesList");
485 var scopesListPageHeader = findChild(scopesList, "pageHeader");
486 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
487- mouseClick(backButton, 0, 0);
488- mouseClick(backButton, 0, 0);
489+ mouseClick(backButton);
490+ mouseClick(backButton);
491 tryCompare(bottomEdgeController, "progress", 0);
492
493 tryCompare(dashContentList, "currentIndex", 0);
494@@ -387,9 +387,9 @@
495 // Enter edit mode
496 var scopesList = findChild(dash, "scopesList");
497 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
498- mousePress(clickScope, 0, 0);
499+ mousePress(clickScope);
500 tryCompare(scopesList, "state", "edit");
501- mouseRelease(clickScope, 0, 0);
502+ mouseRelease(clickScope);
503
504 var starArea = findChild(clickScope, "starArea");
505 touchFlick(starArea, 0, 0, 0, -units.gu(10));
506@@ -401,12 +401,12 @@
507 var scopesList = findChild(dash, "scopesList");
508 var scopesListPageHeader = findChild(scopesList, "pageHeader");
509 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
510- mouseClick(backButton, 0, 0);
511+ mouseClick(backButton);
512
513 // Click on third scope
514 var mockScope5 = findChild(favScopesListCategoryList, "delegateMockScope5");
515 waitForRendering(mockScope5)
516- mouseClick(mockScope5, 0, 0);
517+ mouseClick(mockScope5);
518 tryCompare(bottomEdgeController, "progress", 0);
519 tryCompare(dashContentList, "currentIndex", 2);
520 compare(dashContentList.currentItem.scopeId, "MockScope5");
521
522=== modified file 'tests/qmltests/Dash/tst_DashContent.qml'
523--- tests/qmltests/Dash/tst_DashContent.qml 2014-12-15 14:06:38 +0000
524+++ tests/qmltests/Dash/tst_DashContent.qml 2015-01-09 10:25:35 +0000
525@@ -288,7 +288,7 @@
526 var dashNavigationButton = findChild(dashContentList.currentItem, "navigationButton");
527 compare(dashNavigationButton.showList, false);
528 waitForRendering(dashNavigationButton);
529- mouseClick(dashNavigationButton, dashNavigationButton.width / 2, dashNavigationButton.height / 2);
530+ mouseClick(dashNavigationButton);
531 compare(dashNavigationButton.showList, true);
532
533 var navigationListView = findChild(dashNavigationButton, "navigationListView");
534@@ -304,30 +304,30 @@
535 compare(allButton.visible, false);
536
537 var navigation = findChild(dashNavigationButton, "navigation0child3");
538- mouseClick(navigation, 0, 0);
539+ mouseClick(navigation);
540 compare(dashNavigationButton.showList, false);
541 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle3");
542 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
543
544- mouseClick(dashNavigationButton, 0, 0);
545+ mouseClick(dashNavigationButton);
546 compare(dashNavigationButton.showList, true);
547 waitForRendering(navigationListView);
548 waitForRendering(navigationListView.currentItem);
549 compare(allButton.visible, true);
550
551- mouseClick(allButton, 0, 0);
552+ mouseClick(allButton);
553 compare(dashNavigationButton.showList, false);
554 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
555 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
556
557- mouseClick(dashNavigationButton, 0, 0);
558+ mouseClick(dashNavigationButton);
559 compare(dashNavigationButton.showList, true);
560 waitForRendering(navigationListView);
561 waitForRendering(navigationListView.currentItem);
562 compare(allButton.visible, false);
563
564 navigation = findChild(dashNavigationButton, "navigation0child2");
565- mouseClick(navigation, 0, 0);
566+ mouseClick(navigation);
567 compare(dashNavigationButton.showList, true);
568 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
569 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
570@@ -340,12 +340,12 @@
571
572 tryCompare(navigationListView, "contentX", navigationList1.x);
573 waitForRendering(navigationListView);
574- mouseClick(allButton, 0, 0);
575+ mouseClick(allButton);
576 compare(dashNavigationButton.showList, false);
577 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
578 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
579
580- mouseClick(dashNavigationButton, 0, 0);
581+ mouseClick(dashNavigationButton);
582 compare(dashNavigationButton.showList, true);
583 waitForRendering(navigationListView);
584 waitForRendering(navigationListView.currentItem);
585@@ -354,47 +354,47 @@
586
587 tryCompare(navigationList1.navigation, "loaded", true);
588 navigation = findChild(dashNavigationButton, "navigation1child2");
589- mouseClick(navigation, 0, 0);
590+ mouseClick(navigation);
591 compare(dashNavigationButton.showList, false);
592 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle22");
593 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
594
595- mouseClick(dashNavigationButton, 0, 0);
596+ mouseClick(dashNavigationButton);
597 compare(dashNavigationButton.showList, true);
598 waitForRendering(navigationListView);
599 waitForRendering(navigationListView.currentItem);
600
601 tryCompare(navigationList1.navigation, "loaded", true);
602 navigation = findChild(dashNavigationButton, "navigation1child3");
603- mouseClick(navigation, 0, 0);
604+ mouseClick(navigation);
605 compare(dashNavigationButton.showList, false);
606 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle23");
607 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
608
609- mouseClick(dashNavigationButton, 0, 0);
610+ mouseClick(dashNavigationButton);
611 compare(dashNavigationButton.showList, true);
612 waitForRendering(navigationListView);
613 waitForRendering(navigationListView.currentItem);
614- mouseClick(backButton, 0, 0);
615+ mouseClick(backButton);
616
617 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
618 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
619 compare(dashNavigationButton.showList, true);
620- mouseClick(dashNavigationButton, 0, 0);
621+ mouseClick(dashNavigationButton);
622 compare(dashNavigationButton.showList, false);
623
624- mouseClick(dashNavigationButton, 0, 0);
625+ mouseClick(dashNavigationButton);
626 compare(dashNavigationButton.showList, true);
627 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
628 navigation = findChild(dashNavigationButton, "navigation0child2");
629- mouseClick(navigation, 0, 0);
630+ mouseClick(navigation);
631 compare(dashNavigationButton.showList, true);
632 navigationList1 = findChild(dashNavigationButton, "navigation1");
633 compare(navigationList1.navigation.loaded, false);
634 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
635 allButton = findChild(navigationList1, "allButton");
636 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
637- mouseClick(allButton, 0, 0);
638+ mouseClick(allButton);
639 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
640 }
641
642@@ -408,7 +408,7 @@
643
644 compare(dashNavigationButton.showList, false);
645 waitForRendering(dashNavigationButton);
646- mouseClick(dashNavigationButton, 0, 0);
647+ mouseClick(dashNavigationButton);
648 compare(dashNavigationButton.showList, true);
649
650 var navigationListView = findChild(dashNavigationButton, "navigationListView");
651@@ -429,24 +429,24 @@
652 compare(backButton.visible, false);
653
654 var navigation = findChild(dashNavigationButton, "navigation0child3");
655- mouseClick(navigation, 0, 0);
656+ mouseClick(navigation);
657 compare(dashNavigationButton.showList, false);
658 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild3");
659 tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
660
661- mouseClick(dashNavigationButton, 0, 0);
662+ mouseClick(dashNavigationButton);
663 compare(dashNavigationButton.showList, true);
664 waitForRendering(navigationListView);
665 waitForRendering(navigationListView.currentItem);
666 compare(allButton.visible, false);
667
668 navigation = findChild(dashNavigationButton, "navigation0child2");
669- mouseClick(navigation, 0, 0);
670+ mouseClick(navigation);
671 compare(dashNavigationButton.showList, false);
672 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild2");
673 tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
674
675- mouseClick(dashNavigationButton, 0, 0);
676+ mouseClick(dashNavigationButton);
677 compare(dashNavigationButton.showList, true);
678 waitForRendering(navigationListView);
679 waitForRendering(navigationListView.currentItem);
680@@ -454,7 +454,7 @@
681
682 compare(navigationListView.count, 1, "There should be no second-level navigation");
683
684- mouseClick(dashNavigationButton, 0, 0);
685+ mouseClick(dashNavigationButton);
686 compare(dashNavigationButton.showList, false);
687 }
688
689@@ -474,7 +474,7 @@
690 compare(dashNavigationButton.showList, false);
691 compare(dashAltNavigationButton.showList, false);
692
693- mouseClick(dashNavigation, 0, 0);
694+ mouseClick(dashAltNavigationButton);
695 compare(dashNavigationButton.showList, false);
696 compare(dashAltNavigationButton.showList, true);
697
698@@ -487,20 +487,20 @@
699 var blackRect = findChild(dashNavigation, "blackRect");
700 tryCompare(blackRect, "opacity", 0.5);
701
702- mouseClick(dashNavigation, dashNavigationButton.x, 0);
703+ mouseClick(dashNavigationButton);
704 compare(dashNavigationButton.showList, false);
705 compare(dashAltNavigationButton.showList, false);
706
707 tryCompare(navigationListView, "visible", false);
708
709- mouseClick(dashNavigation, dashNavigationButton.x, 0);
710+ mouseClick(dashNavigationButton);
711 compare(dashNavigationButton.showList, true);
712 compare(dashAltNavigationButton.showList, false);
713
714 navigationListView = findChild(dashNavigationButton, "navigationListView");
715 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
716
717- mouseClick(dashNavigation, 0, 0);
718+ mouseClick(dashAltNavigationButton);
719 compare(dashNavigationButton.showList, false);
720 compare(dashAltNavigationButton.showList, false);
721 }
722
723=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
724--- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-12-15 22:42:11 +0000
725+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2015-01-09 10:25:35 +0000
726@@ -163,12 +163,12 @@
727 verify(!category.expanded);
728
729 var initialHeight = category.height;
730- mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
731+ mouseClick(seeAll);
732 verify(category.expanded);
733 tryCompare(category, "height", category.item.expandedHeight + seeAll.height);
734
735 waitForRendering(seeAll);
736- mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
737+ mouseClick(seeAll);
738 verify(!category.expanded);
739 }
740
741@@ -186,17 +186,17 @@
742 verify(category2.expandable);
743 verify(!category2.expanded);
744
745- mouseClick(seeAll2, seeAll2.width / 2, seeAll2.height / 2);
746+ mouseClick(seeAll2);
747 tryCompare(category2, "expanded", true);
748
749 categoryListView.positionAtBeginning();
750
751 var category0 = findChild(genericScopeView, "dashCategory0")
752 var seeAll0 = findChild(category0, "seeAll")
753- mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
754+ mouseClick(seeAll0);
755 tryCompare(category0, "expanded", true);
756 tryCompare(category2, "expanded", false);
757- mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
758+ mouseClick(seeAll0);
759 tryCompare(category0, "expanded", false);
760 tryCompare(category2, "expanded", false);
761 }
762@@ -208,7 +208,7 @@
763 spy.target = genericScopeView.scope;
764 spy.signalName = "performQuery";
765
766- mouseClick(header, header.width / 2, header.height / 2);
767+ mouseClick(header);
768
769 spy.wait();
770 compare(spy.signalArguments[0][0], genericScopeView.scope.categories.data(1, Categories.RoleHeaderLink));
771@@ -248,13 +248,13 @@
772 categoryListView.contentY = units.gu(20);
773 var seeAll = findChild(category, "seeAll");
774 var floatingSeeLess = findChild(genericScopeView, "floatingSeeLess");
775- mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
776+ mouseClick(seeAll);
777 tryCompare(category, "expanded", true);
778 tryCompareFunction(function() {
779 return category.item.height + floatingSeeLess.height ==
780 genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd;
781 }, true);
782- mouseClick(floatingSeeLess, floatingSeeLess.width / 2, floatingSeeLess.height / 2);
783+ mouseClick(floatingSeeLess);
784 tryCompare(category, "expanded", false);
785 }
786
787@@ -295,7 +295,7 @@
788 true);
789 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
790 waitForRendering(tile);
791- mouseClick(tile, tile.width / 2, tile.height / 2);
792+ mouseClick(tile);
793 tryCompare(testCase.subPageLoader, "open", true);
794 tryCompare(testCase.subPageLoader, "x", 0);
795 tryCompare(findChild(genericScopeView, "categoryListView"), "visible", false);
796@@ -340,15 +340,15 @@
797 tryCompare(testCase.subPageLoader, "open", false);
798 tryCompare(testCase.subPageLoader, "visible", false);
799
800- mouseClick(tile, tile.width / 2, tile.height / 2);
801-
802- tryCompare(testCase.subPageLoader, "open", false);
803- tryCompare(testCase.subPageLoader, "visible", false);
804-
805- mousePress(tile, tile.width / 2, tile.height / 2);
806- tryCompare(testCase.subPageLoader, "open", false);
807- tryCompare(testCase.subPageLoader, "visible", false);
808- mouseRelease(tile, tile.width / 2, tile.height / 2);
809+ mouseClick(tile);
810+
811+ tryCompare(testCase.subPageLoader, "open", false);
812+ tryCompare(testCase.subPageLoader, "visible", false);
813+
814+ mousePress(tile);
815+ tryCompare(testCase.subPageLoader, "open", false);
816+ tryCompare(testCase.subPageLoader, "visible", false);
817+ mouseRelease(tile);
818 }
819
820 function test_showPreviewCarousel() {
821@@ -359,18 +359,18 @@
822 var tile = findChild(category, "carouselDelegate1");
823 verify(tile, "Could not find delegate");
824
825- mouseClick(tile, tile.width / 2, tile.height / 2);
826+ mouseClick(tile);
827 tryCompare(tile, "explicitlyScaled", true);
828- mouseClick(tile, tile.width / 2, tile.height / 2);
829+ mouseClick(tile);
830 tryCompare(testCase.subPageLoader, "open", true);
831 tryCompare(testCase.subPageLoader, "x", 0);
832
833 closePreview();
834
835- mousePress(tile, tile.width / 2, tile.height / 2);
836+ mousePress(tile);
837 tryCompare(testCase.subPageLoader, "open", true);
838 tryCompare(testCase.subPageLoader, "x", 0);
839- mouseRelease(tile, tile.width / 2, tile.height / 2);
840+ mouseRelease(tile);
841
842 closePreview();
843 }
844@@ -383,16 +383,16 @@
845 var tile = findChild(category, "delegate1");
846 verify(tile, "Could not find delegate");
847
848- mouseClick(tile, tile.width / 2, tile.height / 2);
849+ mouseClick(tile);
850 tryCompare(testCase.subPageLoader, "open", true);
851 tryCompare(testCase.subPageLoader, "x", 0);
852
853 closePreview();
854
855- mousePress(tile, tile.width / 2, tile.height / 2);
856+ mousePress(tile);
857 tryCompare(testCase.subPageLoader, "open", true);
858 tryCompare(testCase.subPageLoader, "x", 0);
859- mouseRelease(tile, tile.width / 2, tile.height / 2);
860+ mouseRelease(tile);
861
862 closePreview();
863 }
864@@ -429,7 +429,7 @@
865 tryCompare(testCase.subPageLoader, "open", false);
866 tryCompare(testCase.subPageLoader, "visible", false);
867 var settings = findChild(innerHeader, "settings_header_button");
868- mouseClick(settings, settings.width / 2, settings.height / 2);
869+ mouseClick(settings);
870 tryCompare(testCase.subPageLoader, "open", true);
871 tryCompareFunction(function() { return (String(subPageLoader.source)).indexOf("ScopeSettingsPage.qml") != -1; }, true);
872 tryCompare(genericScopeView, "subPageShown", true);
873@@ -496,7 +496,7 @@
874 verify(category0.expandable);
875 verify(!category0.expanded);
876
877- mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
878+ mouseClick(seeAll0);
879 verify(category0.expanded);
880 tryCompare(category0, "height", category0.item.expandedHeight + seeAll0.height);
881 tryCompare(genericScopeView.categoryView, "contentY", units.gu(14));
882@@ -509,7 +509,7 @@
883 verify(category1.expandable);
884 verify(!category1.expanded);
885
886- mouseClick(seeAll1, seeAll1.width / 2, seeAll1.height / 2);
887+ mouseClick(seeAll1);
888 verify(!category0.expanded);
889 verify(category1.expanded);
890 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
891@@ -539,7 +539,7 @@
892 verify(category0.expandable);
893 verify(!category0.expanded);
894
895- mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
896+ mouseClick(seeAll0);
897 verify(category0.expanded);
898 tryCompare(category0, "height", category0.item.expandedHeight + seeAll0.height);
899
900@@ -550,7 +550,7 @@
901 verify(category1.expandable);
902 verify(!category1.expanded);
903
904- mouseClick(seeAll1, seeAll1.width / 2, seeAll1.height / 2);
905+ mouseClick(seeAll1);
906 verify(!category0.expanded);
907 verify(category1.expanded);
908 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
909@@ -578,7 +578,7 @@
910 expectFail("Apps", "Click scope should not have a favorite button");
911 var favoriteAction = findChild(innerHeader, "favorite_header_button");
912 verify(favoriteAction, "Could not find the favorite action.");
913- mouseClick(favoriteAction, favoriteAction.width / 2, favoriteAction.height / 2);
914+ mouseClick(favoriteAction);
915
916 tryCompare(genericScopeView.scope, "favorite", !data.favorite);
917
918@@ -629,7 +629,7 @@
919 var touchdown = findChild(item0, "touchdown");
920
921 compare(touchdown.visible, false);
922- mouseClick(item0, item0.width / 2, item0.height / 2);
923+ mouseClick(item0);
924 compare(touchdown.visible, false);
925
926 cardTool.template["non-interactive"] = false;
927
928=== modified file 'tests/qmltests/Dash/tst_PageHeader.qml'
929--- tests/qmltests/Dash/tst_PageHeader.qml 2014-08-27 14:36:22 +0000
930+++ tests/qmltests/Dash/tst_PageHeader.qml 2015-01-09 10:25:35 +0000
931@@ -157,7 +157,7 @@
932 var recentSearches = findChild(headerContainer.popover, "recentSearches");
933 verify(recentSearches, "Could not find recent searches in the popover");
934 waitForRendering(recentSearches);
935- mouseClick(recentSearches.itemAt(0), 0, 0);
936+ mouseClick(recentSearches.itemAt(0));
937
938 compare(pageHeader.searchQuery, "Search2");
939 tryCompareFunction(function() { return headerContainer.popover === null; }, true);
940
941=== modified file 'tests/qmltests/Dash/tst_PreviewListView.qml'
942--- tests/qmltests/Dash/tst_PreviewListView.qml 2014-11-24 11:28:41 +0000
943+++ tests/qmltests/Dash/tst_PreviewListView.qml 2015-01-09 10:25:35 +0000
944@@ -73,7 +73,7 @@
945
946 function test_notProcessing() {
947 expectFail("", "processingMouseArea should not receive the click.");
948- mouseClick(listView, listView.width / 2, listView.height / 2);
949+ mouseClick(listView);
950 clickedSpy.wait();
951 }
952
953@@ -83,7 +83,7 @@
954
955 tryCompare(listView, "processing", true);
956
957- mouseClick(listView, listView.width / 2, listView.height / 2);
958+ mouseClick(listView);
959 clickedSpy.wait();
960 }
961
962
963=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
964--- tests/qmltests/Launcher/tst_Launcher.qml 2014-12-08 12:12:35 +0000
965+++ tests/qmltests/Launcher/tst_Launcher.qml 2015-01-09 10:25:35 +0000
966@@ -154,7 +154,7 @@
967 dragLauncherIntoView()
968
969 // tapping on the center of the screen should dismiss the launcher
970- mouseClick(launcher, launcher.width/2, launcher.height/2)
971+ mouseClick(launcher)
972
973 // should eventually get fully retracted (hidden)
974 tryCompare(panel, "x", -launcher.panelWidth, 1000)
975@@ -175,7 +175,7 @@
976
977 verify(appIcon != undefined)
978
979- mouseClick(appIcon, appIcon.width/2, appIcon.height/2)
980+ mouseClick(appIcon)
981
982 tryCompare(launcher, "lastSelectedApplication",
983 "dialer-app")
984@@ -194,7 +194,7 @@
985 var dashIcon = findChild(launcher, "dashItem")
986 verify(dashIcon != undefined)
987
988- mouseClick(dashIcon, dashIcon.width/2, dashIcon.height/2)
989+ mouseClick(dashIcon)
990
991 tryCompare(launcher, "showDashHome_count", 1)
992
993@@ -413,7 +413,7 @@
994 compare(quickListShape.visible, false)
995
996 // Doing longpress
997- mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2)
998+ mousePress(draggedItem)
999 tryCompare(fakeDragItem, "visible", true) // Wait longpress happening
1000 tryCompare(quickListShape, "visible", true)
1001
1002@@ -448,7 +448,7 @@
1003 }
1004
1005 // Doing longpress
1006- mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2);
1007+ mousePress(draggedItem);
1008 tryCompare(quickListShape, "opacity", 0.96);
1009 mouseRelease(draggedItem);
1010
1011@@ -481,7 +481,7 @@
1012 tryCompare(quickListShape, "visible", false)
1013
1014 // Doing longpress
1015- mousePress(clickedItem, clickedItem.width / 2, clickedItem.height / 2)
1016+ mousePress(clickedItem)
1017 tryCompare(clickedItem, "itemOpacity", 0) // Wait for longpress to happen
1018 verify(quickListShape.visible, "QuickList must be visible")
1019
1020@@ -492,7 +492,7 @@
1021 signalSpy.clear();
1022 signalSpy.signalName = "quickListTriggered"
1023
1024- mouseClick(quickListEntry, quickListEntry.width / 2, quickListEntry.height / 2)
1025+ mouseClick(quickListEntry)
1026
1027 if (data.clickable) {
1028 // QuickList needs to be closed when some clickable item is clicked
1029@@ -524,7 +524,7 @@
1030 tryCompare(quickList, "state", "")
1031
1032 // Doing longpress
1033- mousePress(clickedItem, clickedItem.width / 2, clickedItem.height / 2)
1034+ mousePress(clickedItem)
1035 tryCompare(clickedItem, "itemOpacity", 0) // Wait for longpress to happen
1036 verify(quickList, "state", "open")
1037
1038
1039=== modified file 'tests/qmltests/Notifications/tst_Notifications.qml'
1040--- tests/qmltests/Notifications/tst_Notifications.qml 2014-11-07 10:10:53 +0000
1041+++ tests/qmltests/Notifications/tst_Notifications.qml 2015-01-09 10:25:35 +0000
1042@@ -547,7 +547,7 @@
1043 compare(valueLabel.visible, data.valueLabelVisible, "value-label visibility is incorrect")
1044
1045 // test input does not fall through
1046- mouseClick(notification, notification.width / 2, notification.height / 2)
1047+ mouseClick(notification)
1048 if(data.type == Notification.Interactive) {
1049 actionSpy.wait()
1050 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
1051@@ -568,7 +568,7 @@
1052
1053 // only test the left/cancel-button if two actions have been passed in
1054 if (data.actions.length == 2) {
1055- tryCompareFunction(function() { mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2); return actionSpy.signalArguments.length > 0; }, true);
1056+ tryCompareFunction(function() { mouseClick(buttonCancel); return actionSpy.signalArguments.length > 0; }, true);
1057 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
1058 actionSpy.clear()
1059 }
1060@@ -577,7 +577,7 @@
1061 verify(buttonAccept.color === data.buttonTinted ? "#3fb24f" : "#dddddd", "button has the wrong color-tint")
1062
1063 // click the positive/right button
1064- tryCompareFunction(function() { mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2); return actionSpy.signalArguments.length > 0; }, true);
1065+ tryCompareFunction(function() { mouseClick(buttonAccept); return actionSpy.signalArguments.length > 0; }, true);
1066 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
1067 actionSpy.clear()
1068 waitForRendering (notification)
1069@@ -592,19 +592,19 @@
1070
1071 // try clicking on choices in expanded comboList
1072 var choiceButton1 = findChild(notification, "notify_button3")
1073- tryCompareFunction(function() { mouseClick(choiceButton1, choiceButton1.width / 2, choiceButton1.height / 2); return actionSpy.signalArguments.length > 0; }, true);
1074+ tryCompareFunction(function() { mouseClick(choiceButton1); return actionSpy.signalArguments.length > 0; }, true);
1075 compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
1076 actionSpy.clear()
1077
1078 var choiceButton2 = findChild(notification, "notify_button4")
1079- tryCompareFunction(function() { mouseClick(choiceButton2, choiceButton2.width / 2, choiceButton2.height / 2); return actionSpy.signalArguments.length > 0; }, true);
1080+ tryCompareFunction(function() { mouseClick(choiceButton2); return actionSpy.signalArguments.length > 0; }, true);
1081 compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
1082 actionSpy.clear()
1083
1084 // click to collapse
1085 //tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
1086 } else {
1087- mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
1088+ mouseClick(buttonCancel)
1089 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
1090 }
1091 }
1092
1093=== modified file 'tests/qmltests/Notifications/tst_OptionToggle.qml'
1094--- tests/qmltests/Notifications/tst_OptionToggle.qml 2014-11-06 16:14:24 +0000
1095+++ tests/qmltests/Notifications/tst_OptionToggle.qml 2015-01-09 10:25:35 +0000
1096@@ -223,7 +223,7 @@
1097 }
1098
1099 // test input does not fall through
1100- mouseClick(notification, notification.width / 2, notification.height / 2)
1101+ mouseClick(notification)
1102 if(data.type == Notification.Interactive) {
1103 actionSpy.wait()
1104 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
1105@@ -244,7 +244,7 @@
1106
1107 // only test the left/cancel-button if two actions have been passed in
1108 if (data.actions.length == 2) {
1109- tryCompareFunction(function() { mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2); return actionSpy.signalArguments.length > 0; }, true);
1110+ tryCompareFunction(function() { mouseClick(buttonCancel); return actionSpy.signalArguments.length > 0; }, true);
1111 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
1112 actionSpy.clear()
1113 }
1114@@ -253,7 +253,7 @@
1115 verify(buttonAccept.color === data.buttonTinted ? "#3fb24f" : "#dddddd", "button has the wrong color-tint")
1116
1117 // click the positive/right button
1118- tryCompareFunction(function() { mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2); return actionSpy.signalArguments.length > 0; }, true);
1119+ tryCompareFunction(function() { mouseClick(buttonAccept); return actionSpy.signalArguments.length > 0; }, true);
1120 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
1121 actionSpy.clear()
1122 waitForRendering(notification)
1123@@ -264,20 +264,20 @@
1124 tryCompareFunction(function() { return optionToggle.expanded == false; }, true);
1125
1126 // click to expand
1127- tryCompareFunction(function() { mouseClick(optionToggle, optionToggle.width / 2, optionToggle.height / 2); return optionToggle.expanded == true; }, true);
1128+ tryCompareFunction(function() { mouseClick(optionToggle); return optionToggle.expanded == true; }, true);
1129
1130 // try clicking on choices in expanded comboList
1131 var choiceButton1 = findChild(notification, "notify_button3")
1132- tryCompareFunction(function() { mouseClick(choiceButton1, choiceButton1.width / 2, choiceButton1.height / 2); return actionSpy.signalArguments.length > 0; }, true);
1133+ tryCompareFunction(function() { mouseClick(choiceButton1); return actionSpy.signalArguments.length > 0; }, true);
1134 compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
1135 actionSpy.clear()
1136
1137 var choiceButton2 = findChild(notification, "notify_button4")
1138- tryCompareFunction(function() { mouseClick(choiceButton2, choiceButton2.width / 2, choiceButton2.height / 2); return actionSpy.signalArguments.length > 0; }, true);
1139+ tryCompareFunction(function() { mouseClick(choiceButton2); return actionSpy.signalArguments.length > 0; }, true);
1140 compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
1141 actionSpy.clear()
1142 } else {
1143- mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
1144+ mouseClick(buttonCancel)
1145 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
1146 }
1147 }
1148
1149=== modified file 'tests/qmltests/Notifications/tst_SwipeToAct.qml'
1150--- tests/qmltests/Notifications/tst_SwipeToAct.qml 2014-11-05 14:28:18 +0000
1151+++ tests/qmltests/Notifications/tst_SwipeToAct.qml 2015-01-09 10:25:35 +0000
1152@@ -240,7 +240,7 @@
1153 }
1154
1155 // test input does not fall through
1156- mouseClick(notification, notification.width / 2, notification.height / 2)
1157+ mouseClick(notification)
1158 if(data.type == Notification.Interactive) {
1159 actionSpy.wait()
1160 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
1161
1162=== modified file 'tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml'
1163--- tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml 2014-07-11 16:01:44 +0000
1164+++ tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml 2015-01-09 10:25:35 +0000
1165@@ -214,7 +214,7 @@
1166
1167 // click/tap on each snap-decision and verify only one is in expanded-state at any time
1168 for (var index = 0; index < snap_decision.length; index++) {
1169- mouseClick(snap_decision[index], snap_decision[index].width / 2, snap_decision[index].height / 2)
1170+ mouseClick(snap_decision[index])
1171 for (var kindex = 0; kindex < snap_decision.length; kindex++) {
1172 if (kindex == index) {
1173 compare(snap_decision[kindex].state, "expanded", "state of "+ kindex + ".snap-decision is not expanded");
1174@@ -227,7 +227,7 @@
1175 // remove top-most and verify one of the remaining ones is still getting expanded
1176
1177 // make first snap-decision expand
1178- mouseClick(snap_decision[0], snap_decision[0].width / 2, snap_decision[0].height / 2);
1179+ mouseClick(snap_decision[0]);
1180
1181 for (var index = 1; index < snap_decision.length; index++) {
1182 removeTopMostNotification();
1183
1184=== modified file 'tests/qmltests/Panel/tst_IndicatorsBar.qml'
1185--- tests/qmltests/Panel/tst_IndicatorsBar.qml 2014-12-03 13:39:44 +0000
1186+++ tests/qmltests/Panel/tst_IndicatorsBar.qml 2015-01-09 10:25:35 +0000
1187@@ -197,7 +197,7 @@
1188 if (indicatorsBar.mapFromItem(dataItem, dataItem.width/2, dataItem.height/2).x < 0) {
1189 skip("Out of bounds");
1190 }
1191- mouseClick(dataItem, dataItem.width/2, dataItem.height/2);
1192+ mouseClick(dataItem);
1193 verify(dataItem.selected === true);
1194 }
1195
1196
1197=== modified file 'tests/qmltests/tst_Shell.qml'
1198--- tests/qmltests/tst_Shell.qml 2014-12-11 13:24:26 +0000
1199+++ tests/qmltests/tst_Shell.qml 2015-01-09 10:25:35 +0000
1200@@ -245,7 +245,7 @@
1201
1202 // Clicking the button should dismiss the notification and return focus
1203 var buttonAccept = findChild(notification, "notify_button0");
1204- mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2);
1205+ mouseClick(buttonAccept);
1206
1207 // Make sure we're back to normal
1208 tryCompare(app.session.surface, "activeFocus", true);
1209@@ -463,7 +463,7 @@
1210 var launcher = findChild(shell, "launcherPanel")
1211 tryCompareFunction(function() {return launcher.x === 0 || launcher.x === -launcher.width;}, true);
1212 if (launcher.x === 0) {
1213- mouseClick(shell, shell.width / 2, shell.height / 2)
1214+ mouseClick(shell)
1215 }
1216 tryCompare(launcher, "x", -launcher.width)
1217
1218
1219=== modified file 'tests/qmltests/tst_TabletShell.qml'
1220--- tests/qmltests/tst_TabletShell.qml 2014-12-08 19:00:15 +0000
1221+++ tests/qmltests/tst_TabletShell.qml 2015-01-09 10:25:35 +0000
1222@@ -211,7 +211,7 @@
1223 tryCompare(passwordMouseArea, "enabled", isButton)
1224
1225 var passwordInput = findChild(shell, "passwordInput")
1226- mouseClick(passwordInput, passwordInput.width / 2, passwordInput.height / 2)
1227+ mouseClick(passwordInput)
1228 }
1229
1230 function confirmLoggedIn(loggedIn) {
1231
1232=== modified file 'tests/utils/modules/Unity/Test/UnityTestCase.qml'
1233--- tests/utils/modules/Unity/Test/UnityTestCase.qml 2014-11-24 11:17:33 +0000
1234+++ tests/utils/modules/Unity/Test/UnityTestCase.qml 2015-01-09 10:25:35 +0000
1235@@ -37,6 +37,67 @@
1236 this.getCurrentTimeMs = function() {return this.currentTimeMs}
1237 }
1238
1239+ function mouseClick(item, x, y, button, modifiers, delay) {
1240+ if (button === undefined)
1241+ button = Qt.LeftButton;
1242+ if (modifiers === undefined)
1243+ modifiers = Qt.NoModifier;
1244+ if (delay === undefined)
1245+ delay = -1;
1246+ if (x === undefined)
1247+ x = item.width / 2;
1248+ if (y === undefined)
1249+ y = item.height / 2;
1250+ if (!qtest_events.mouseClick(item, x, y, button, modifiers, delay))
1251+ qtest_fail("window not shown", 2);
1252+ }
1253+
1254+ function mouseDoubleClick(item, x, y, button, modifiers, delay) {
1255+ if (button === undefined)
1256+ button = Qt.LeftButton;
1257+ if (modifiers === undefined)
1258+ modifiers = Qt.NoModifier;
1259+ if (delay === undefined)
1260+ delay = -1;
1261+ if (x === undefined)
1262+ x = item.width / 2;
1263+ if (y === undefined)
1264+ y = item.height / 2;
1265+ if (!qtest_events.mouseDoubleClick(item, x, y, button, modifiers, delay))
1266+ qtest_fail("window not shown", 2)
1267+ }
1268+
1269+ function mousePress(item, x, y, button, modifiers, delay) {
1270+ if (button === undefined)
1271+ button = Qt.LeftButton;
1272+ if (modifiers === undefined)
1273+ modifiers = Qt.NoModifier;
1274+ if (delay === undefined)
1275+ delay = -1;
1276+ if (x === undefined)
1277+ x = item.width / 2;
1278+ if (y === undefined)
1279+ y = item.height / 2;
1280+ if (!qtest_events.mousePress(item, x, y, button, modifiers, delay))
1281+ qtest_fail("window not shown", 2)
1282+ }
1283+
1284+ function mouseRelease(item, x, y, button, modifiers, delay) {
1285+ if (button === undefined)
1286+ button = Qt.LeftButton;
1287+ if (modifiers === undefined)
1288+ modifiers = Qt.NoModifier;
1289+ if (delay === undefined)
1290+ delay = -1;
1291+ if (x === undefined)
1292+ x = item.width / 2;
1293+ if (y === undefined)
1294+ y = item.height / 2;
1295+ if (!qtest_events.mouseRelease(item, x, y, button, modifiers, delay))
1296+ qtest_fail("window not shown", 2)
1297+ }
1298+
1299+
1300 // Flickable won't recognise a single mouse move as dragging the flickable.
1301 // Use 5 steps because it's what
1302 // Qt uses in QQuickViewTestUtil::flick

Subscribers

People subscribed via source and target branches