on xenial help sign in
Test: By default mouseX act on the middle
08c32e0Albert Astals
tests/qmltests/Components/tst_Carousel.qml+5−5
@@ -274,20 +274,20 @@ Item {
274
274
275 spy.signalName = "clicked";
275 spy.signalName = "clicked";
276 spy.target = carouselItem;
276 spy.target = carouselItem;
277− mouseClick(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
277+ mouseClick(carouselItem);
278 tryCompare(carouselList, "moving", false);
278 tryCompare(carouselList, "moving", false);
279 tryCompare(carouselItem, "explicitlyScaled", true);
279 tryCompare(carouselItem, "explicitlyScaled", true);
280− mouseClick(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
280+ mouseClick(carouselItem);
281 spy.wait();
281 spy.wait();
282
282
283 spy.signalName = "pressAndHold";
283 spy.signalName = "pressAndHold";
284 spy.target = carouselItem;
284 spy.target = carouselItem;
285− mouseClick(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
285+ mouseClick(carouselItem);
286 tryCompare(carouselList, "moving", false);
286 tryCompare(carouselList, "moving", false);
287 tryCompare(carouselItem, "explicitlyScaled", true);
287 tryCompare(carouselItem, "explicitlyScaled", true);
288− mousePress(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
288+ mousePress(carouselItem);
289 spy.wait();
289 spy.wait();
290− mouseRelease(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
290+ mouseRelease(carouselItem);
291 }
291 }
292 }
292 }
293}
293}
tests/qmltests/Components/tst_Lockscreen.qml+1−1
@@ -421,7 +421,7 @@ Rectangle {
421 signalSpy.clear();
421 signalSpy.clear();
422
422
423 var okButton = findChild(root, "infoPopupOkButton");
423 var okButton = findChild(root, "infoPopupOkButton");
424− mouseClick(okButton, okButton.width / 2, okButton.height / 2);
424+ mouseClick(okButton);
425
425
426 tryCompareFunction(function() { return findChild(root, "infoPopup") === null}, true);
426 tryCompareFunction(function() { return findChild(root, "infoPopup") === null}, true);
427
427
tests/qmltests/Dash/Previews/tst_PreviewActions.qml+3−3
@@ -104,7 +104,7 @@ Rectangle {
104 var button = findChild(root, "button" + id);
104 var button = findChild(root, "button" + id);
105 verify(button != null);
105 verify(button != null);
106 spy.target = target;
106 spy.target = target;
107− mouseClick(button, button.width / 2, button.height / 2);
107+ mouseClick(button);
108 compare(spy.count, 1);
108 compare(spy.count, 1);
109 compare(spy.signalArguments[0][0], target.widgetId);
109 compare(spy.signalArguments[0][0], target.widgetId);
110 compare(spy.signalArguments[0][1], id);
110 compare(spy.signalArguments[0][1], id);
@@ -137,11 +137,11 @@ Rectangle {
137 var buttonColumn = findChild(root, "buttonColumn");
137 var buttonColumn = findChild(root, "buttonColumn");
138 verify(button != null);
138 verify(button != null);
139 var twoActionsY = twoActions.y
139 var twoActionsY = twoActions.y
140− mouseClick(button, button.width / 2, button.height / 2);
140+ mouseClick(button);
141 tryCompareFunction(function () { return twoActions.y <= twoActionsY; }, false);
141 tryCompareFunction(function () { return twoActions.y <= twoActionsY; }, false);
142 tryCompare(buttonColumn, "height", buttonColumn.implicitHeight);
142 tryCompare(buttonColumn, "height", buttonColumn.implicitHeight);
143 checkButtonPressSignal(buttonAndCombo, data.id, data.buttonNumber);
143 checkButtonPressSignal(buttonAndCombo, data.id, data.buttonNumber);
144− mouseClick(button, button.width / 2, button.height / 2);
144+ mouseClick(button);
145 tryCompare(twoActions, "y", twoActionsY);
145 tryCompare(twoActions, "y", twoActionsY);
146 }
146 }
147 }
147 }
tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml+5−5
@@ -131,7 +131,7 @@ Rectangle {
131 compare(track2ProgressBar.visible, false);
131 compare(track2ProgressBar.visible, false);
132
132
133 // Playing track 0 should make progress bar 0 visible
133 // Playing track 0 should make progress bar 0 visible
134− mouseClick(track0PlayButton, track0PlayButton.width / 2, track0PlayButton.height / 2);
134+ mouseClick(track0PlayButton);
135
135
136 tryCompare(audio, "playbackState", Audio.PlayingState);
136 tryCompare(audio, "playbackState", Audio.PlayingState);
137 checkPlayerSource(0);
137 checkPlayerSource(0);
@@ -141,18 +141,18 @@ Rectangle {
141 tryCompare(track2ProgressBar, "visible", false);
141 tryCompare(track2ProgressBar, "visible", false);
142
142
143 // Clicking the button again should pause it. The progress bar should stay visible
143 // Clicking the button again should pause it. The progress bar should stay visible
144− mouseClick(track0PlayButton, track0PlayButton.width / 2, track0PlayButton.height / 2);
144+ mouseClick(track0PlayButton);
145 tryCompare(audio, "playbackState", Audio.PausedState);
145 tryCompare(audio, "playbackState", Audio.PausedState);
146 checkPlayerSource(0);
146 checkPlayerSource(0);
147 tryCompare(track0ProgressBar, "visible", true);
147 tryCompare(track0ProgressBar, "visible", true);
148
148
149 // Continue playback
149 // Continue playback
150− mouseClick(track0PlayButton, track0PlayButton.width / 2, track0PlayButton.height / 2);
150+ mouseClick(track0PlayButton);
151 tryCompare(audio, "playbackState", Audio.PlayingState);
151 tryCompare(audio, "playbackState", Audio.PlayingState);
152 checkPlayerSource(0);
152 checkPlayerSource(0);
153
153
154 // Playing track 1 should make progress bar 1 visible and hide progress bar 0 again
154 // Playing track 1 should make progress bar 1 visible and hide progress bar 0 again
155− mouseClick(track1PlayButton, track1PlayButton.width / 2, track1PlayButton.height / 2);
155+ mouseClick(track1PlayButton);
156
156
157 tryCompare(audio, "playbackState", Audio.PlayingState);
157 tryCompare(audio, "playbackState", Audio.PlayingState);
158 checkPlayerSource(1);
158 checkPlayerSource(1);
@@ -162,7 +162,7 @@ Rectangle {
162 tryCompare(track2ProgressBar, "visible", false);
162 tryCompare(track2ProgressBar, "visible", false);
163
163
164 // Playing track 2 should make progress bar 1 visible and hide progress bar 0 again
164 // Playing track 2 should make progress bar 1 visible and hide progress bar 0 again
165− mouseClick(track2PlayButton, track2PlayButton.width / 2, track2PlayButton.height / 2);
165+ mouseClick(track2PlayButton);
166
166
167 tryCompare(audio, "playbackState", Audio.PlayingState);
167 tryCompare(audio, "playbackState", Audio.PlayingState);
168 checkPlayerSource(2);
168 checkPlayerSource(2);
tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml+2−2
@@ -85,7 +85,7 @@ Rectangle {
85
85
86 function test_expand_collapse() {
86 function test_expand_collapse() {
87 var expandButton = findChild(previewExpandable, "expandButton")
87 var expandButton = findChild(previewExpandable, "expandButton")
88− mouseClick(expandButton, expandButton.width / 2, expandButton.height / 2);
88+ mouseClick(expandButton);
89
89
90 var repeater = findChild(previewExpandable, "repeater")
90 var repeater = findChild(previewExpandable, "repeater")
91 compare(repeater.count, 4)
91 compare(repeater.count, 4)
@@ -99,7 +99,7 @@ Rectangle {
99 compare (repeater.itemAt(2).expanded, true);
99 compare (repeater.itemAt(2).expanded, true);
100 compare (repeater.itemAt(3).expanded, true);
100 compare (repeater.itemAt(3).expanded, true);
101
101
102− mouseClick(expandButton, expandButton.width / 2, expandButton.height / 2);
102+ mouseClick(expandButton);
103
103
104 checkInitialState();
104 checkInitialState();
105 }
105 }
tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+6−6
@@ -67,23 +67,23 @@ Rectangle {
67
67
68 function test_overlayOpenClose() {
68 function test_overlayOpenClose() {
69 var image0 = findChild(imageGallery, "previewImage0");
69 var image0 = findChild(imageGallery, "previewImage0");
70− mouseClick(image0, image0.width / 2, image0.height / 2);
70+ mouseClick(image0);
71 tryCompare(overlay, "visible", true);
71 tryCompare(overlay, "visible", true);
72 tryCompare(overlay, "scale", 1.0);
72 tryCompare(overlay, "scale", 1.0);
73 tryCompare(overlayCloseButton, "visible", true);
73 tryCompare(overlayCloseButton, "visible", true);
74− mouseClick(overlayCloseButton, overlayCloseButton.width / 2, overlayCloseButton.height / 2);
74+ mouseClick(overlayCloseButton);
75 tryCompare(overlay, "visible", false);
75 tryCompare(overlay, "visible", false);
76 }
76 }
77
77
78 function test_overlayShowHideHeader() {
78 function test_overlayShowHideHeader() {
79 var image0 = findChild(imageGallery, "previewImage0");
79 var image0 = findChild(imageGallery, "previewImage0");
80− mouseClick(image0, image0.width / 2, image0.height / 2);
80+ mouseClick(image0);
81 tryCompare(overlay, "visible", true);
81 tryCompare(overlay, "visible", true);
82 tryCompare(overlay, "scale", 1.0);
82 tryCompare(overlay, "scale", 1.0);
83 tryCompare(overlayCloseButton, "visible", true);
83 tryCompare(overlayCloseButton, "visible", true);
84− mouseClick(overlay, overlay.width / 2, overlay.height / 2);
84+ mouseClick(overlay);
85 tryCompare(overlayCloseButton, "visible", false);
85 tryCompare(overlayCloseButton, "visible", false);
86− mouseClick(overlay, overlay.width / 2, overlay.height / 2);
86+ mouseClick(overlay);
87 tryCompare(overlayCloseButton, "visible", true);
87 tryCompare(overlayCloseButton, "visible", true);
88 }
88 }
89
89
@@ -97,7 +97,7 @@ Rectangle {
97
97
98 function test_overlayOpenCorrectImage(data) {
98 function test_overlayOpenCorrectImage(data) {
99 var image = findChild(imageGallery, "previewImage" + data.index);
99 var image = findChild(imageGallery, "previewImage" + data.index);
100− mouseClick(image, image.width / 2, image.height / 2);
100+ mouseClick(image);
101 tryCompare(overlay, "visible", true);
101 tryCompare(overlay, "visible", true);
102 tryCompare(overlay, "scale", 1.0);
102 tryCompare(overlay, "scale", 1.0);
103 tryCompare(overlayListView, "currentIndex", data.index);
103 tryCompare(overlayListView, "currentIndex", data.index);
tests/qmltests/Dash/Previews/tst_PreviewPayments.qml+5−5
@@ -84,7 +84,7 @@ Rectangle {
84 var button = findChild(previewPayments, "paymentButton");
84 var button = findChild(previewPayments, "paymentButton");
85 verify(button, "Button not found.");
85 verify(button, "Button not found.");
86
86
87− mouseClick(button, button.width / 2, button.height / 2);
87+ mouseClick(button);
88
88
89 paymentClient.process();
89 paymentClient.process();
90 spy.wait();
90 spy.wait();
@@ -107,7 +107,7 @@ Rectangle {
107 tryCompare(button, "visible", true);
107 tryCompare(button, "visible", true);
108 tryCompare(button, "opacity", 1);
108 tryCompare(button, "opacity", 1);
109
109
110− mouseClick(button, button.width / 2, button.height / 2);
110+ mouseClick(button););
111
111
112 paymentClient.process();
112 paymentClient.process();
113 spy.wait();
113 spy.wait();
@@ -130,7 +130,7 @@ Rectangle {
130 tryCompare(button, "visible", true);
130 tryCompare(button, "visible", true);
131 tryCompare(button, "opacity", 1);
131 tryCompare(button, "opacity", 1);
132
132
133− mouseClick(button, button.width / 2, button.height / 2);
133+ mouseClick(button););
134
134
135 tryCompare(progress, "visible", true);
135 tryCompare(progress, "visible", true);
136 tryCompare(progress, "opacity", 1);
136 tryCompare(progress, "opacity", 1);
@@ -154,7 +154,7 @@ Rectangle {
154 var button = findChild(previewPayments, "paymentButton");
154 var button = findChild(previewPayments, "paymentButton");
155 verify(button, "Button not found.");
155 verify(button, "Button not found.");
156
156
157− mouseClick(button, button.width / 2, button.height / 2);
157+ mouseClick(button););
158
158
159 paymentClient.process();
159 paymentClient.process();
160 spy.wait();
160 spy.wait();
@@ -175,7 +175,7 @@ Rectangle {
175 verify(button, "Button not found.");
175 verify(button, "Button not found.");
176 verify(progress, "Progress not found.");
176 verify(progress, "Progress not found.");
177
177
178− mouseClick(button, button.width / 2, button.height / 2);
178+ mouseClick(button););
179
179
180 tryCompare(progress, "visible", true);
180 tryCompare(progress, "visible", true);
181 tryCompare(progress, "opacity", 1);
181 tryCompare(progress, "opacity", 1);
tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml+1−1
@@ -118,7 +118,7 @@ Rectangle {
118 compare(rating.value, reviewsModel1["reviews"][1]["rating"]);
118 compare(rating.value, reviewsModel1["reviews"][1]["rating"]);
119
119
120 // Tap on first star
120 // Tap on first star
121− mouseClick(rating, 0, 0);
121+ mouseClick(rating);
122 compare(rating.value, reviewsModel1["reviews"][1]["rating"]);
122 compare(rating.value, reviewsModel1["reviews"][1]["rating"]);
123 }
123 }
124 }
124 }
tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml+2−2
@@ -139,7 +139,7 @@ Rectangle {
139 verify(reviewTextArea.visible === true);
139 verify(reviewTextArea.visible === true);
140
140
141 reviewTextArea.text = data.inputText;
141 reviewTextArea.text = data.inputText;
142− mouseClick(submitButton, submitButton.width / 2, submitButton.height / 2);
142+ mouseClick(submitButton);
143 switch (data.widgetData["required"]) {
143 switch (data.widgetData["required"]) {
144 case "rating": {
144 case "rating": {
145 if (rating.visible === false || data.inputRating < 0) {
145 if (rating.visible === false || data.inputRating < 0) {
@@ -187,7 +187,7 @@ Rectangle {
187 if (data.inputRating > 0) rating.value = data.inputRating;
187 if (data.inputRating > 0) rating.value = data.inputRating;
188 if (data.inputText !== "") {
188 if (data.inputText !== "") {
189 reviewTextArea.text = data.inputText;
189 reviewTextArea.text = data.inputText;
190− mouseClick(submitButton, submitButton.width / 2, submitButton.height / 2);
190+ mouseClick(submitButton);
191 }
191 }
192
192
193 compare(spy.count, 1);
193 compare(spy.count, 1);
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+2−2
@@ -72,11 +72,11 @@ Rectangle {
72
72
73 function test_zoomableImageOpenClose() {
73 function test_zoomableImageOpenClose() {
74 var overlayCloseButton = findChild(overlay, "overlayCloseButton");
74 var overlayCloseButton = findChild(overlay, "overlayCloseButton");
75− mouseClick(lazyImage, lazyImage.width / 2, lazyImage.height / 2);
75+ mouseClick(lazyImage);
76 tryCompare(overlay, "visible", true);
76 tryCompare(overlay, "visible", true);
77 tryCompare(overlay, "scale", 1.0);
77 tryCompare(overlay, "scale", 1.0);
78 tryCompare(overlayCloseButton, "visible", true);
78 tryCompare(overlayCloseButton, "visible", true);
79− mouseClick(overlayCloseButton, overlayCloseButton.width / 2, overlayCloseButton.height / 2);
79+ mouseClick(overlayCloseButton);
80 tryCompare(overlay, "visible", false);
80 tryCompare(overlay, "visible", false);
81 }
81 }
82 }
82 }
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingBoolean.qml+2−2
@@ -49,12 +49,12 @@ Rectangle {
49
49
50 function test_updated() {
50 function test_updated() {
51 var control = findChild(scopeSetting, "control");
51 var control = findChild(scopeSetting, "control");
52− mouseClick(control, control.width / 2, control.height / 2);
52+ mouseClick(control);
53 spy.wait();
53 spy.wait();
54 compare(spy.signalArguments[0][0], false);
54 compare(spy.signalArguments[0][0], false);
55
55
56 spy.clear();
56 spy.clear();
57− mouseClick(scopeSetting, scopeSetting.width / 2, scopeSetting.height / 2);
57+ mouseClick(scopeSetting);
58 spy.wait();
58 spy.wait();
59 compare(spy.signalArguments[0][0], true);
59 compare(spy.signalArguments[0][0], true);
60 }
60 }
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingNumber.qml+3−3
@@ -57,7 +57,7 @@ Rectangle {
57 }
57 }
58
58
59 function test_updated_on_unfocus() {
59 function test_updated_on_unfocus() {
60− mouseClick(control, control.width / 2, control.height / 2);
60+ mouseClick(control);
61 control.selectAll();
61 control.selectAll();
62 control.cut();
62 control.cut();
63 control.insert(0, newNumber);
63 control.insert(0, newNumber);
@@ -67,7 +67,7 @@ Rectangle {
67 }
67 }
68
68
69 function test_updated_on_accepted() {
69 function test_updated_on_accepted() {
70− mouseClick(control, control.width / 2, control.height / 2);
70+ mouseClick(control);
71 control.selectAll();
71 control.selectAll();
72 control.cut();
72 control.cut();
73 control.insert(0, newNumber);
73 control.insert(0, newNumber);
@@ -86,7 +86,7 @@ Rectangle {
86 }
86 }
87
87
88 function test_unacceptable_input() {
88 function test_unacceptable_input() {
89− mouseClick(control, control.width / 2, control.height / 2);
89+ mouseClick(control);
90 control.selectAll();
90 control.selectAll();
91 control.cut();
91 control.cut();
92 control.insert(0, "not valid");
92 control.insert(0, "not valid");
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingString.qml+2−2
@@ -57,7 +57,7 @@ Rectangle {
57 }
57 }
58
58
59 function test_updated_on_unfocus() {
59 function test_updated_on_unfocus() {
60− mouseClick(control, control.width / 2, control.height / 2);
60+ mouseClick(control);
61 control.selectAll();
61 control.selectAll();
62 control.cut();
62 control.cut();
63 control.insert(0, newText);
63 control.insert(0, newText);
@@ -67,7 +67,7 @@ Rectangle {
67 }
67 }
68
68
69 function test_updated_on_accepted() {
69 function test_updated_on_accepted() {
70− mouseClick(control, control.width / 2, control.height / 2);
70+ mouseClick(control);
71 control.selectAll();
71 control.selectAll();
72 control.cut();
72 control.cut();
73 control.insert(0, newText);
73 control.insert(0, newText);
tests/qmltests/Dash/tst_Card.qml+2−2
@@ -539,9 +539,9 @@ Rectangle {
539 var touchdown = findChild(card, "touchdown");
539 var touchdown = findChild(card, "touchdown");
540
540
541 compare(touchdown.visible, false);
541 compare(touchdown.visible, false);
542− mousePress(card, card.width/2, card.height/2);
542+ mousePress(card);
543 compare(touchdown.visible, true);
543 compare(touchdown.visible, true);
544− mouseRelease(card, card.width/2, card.height/2);
544+ mouseRelease(card);
545 compare(touchdown.visible, false);
545 compare(touchdown.visible, false);
546 }
546 }
547
547
tests/qmltests/Dash/tst_Dash.qml+19−19
@@ -90,7 +90,7 @@ Item {
90 var scopesList = findChild(dash, "scopesList");
90 var scopesList = findChild(dash, "scopesList");
91 var scopesListPageHeader = findChild(scopesList, "pageHeader");
91 var scopesListPageHeader = findChild(scopesList, "pageHeader");
92 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
92 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
93− mouseClick(backButton, 0, 0);
93+ mouseClick(backButton);
94 tryCompare(bottomEdgeController, "progress", 0);
94 tryCompare(bottomEdgeController, "progress", 0);
95 }
95 }
96
96
@@ -106,7 +106,7 @@ Item {
106 tryCompare(favScopesListCategoryList, "currentIndex", 0);
106 tryCompare(favScopesListCategoryList, "currentIndex", 0);
107
107
108 // Click in first item
108 // Click in first item
109− mouseClick(favScopesListCategoryList.currentItem, 0, 0);
109+ mouseClick(favScopesListCategoryList.currentItem);
110
110
111 // Make sure animation went back
111 // Make sure animation went back
112 tryCompare(bottomEdgeController, "progress", 0);
112 tryCompare(bottomEdgeController, "progress", 0);
@@ -128,7 +128,7 @@ Item {
128
128
129 // Click in second item
129 // Click in second item
130 favScopesListCategoryList.currentIndex = 1;
130 favScopesListCategoryList.currentIndex = 1;
131− mouseClick(favScopesListCategoryList.currentItem, 0, 0);
131+ mouseClick(favScopesListCategoryList.currentItem);
132
132
133 // Make sure animation went back
133 // Make sure animation went back
134 tryCompare(bottomEdgeController, "progress", 0);
134 tryCompare(bottomEdgeController, "progress", 0);
@@ -148,7 +148,7 @@ Item {
148 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
148 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
149
149
150 // Click on a non favorite scope
150 // Click on a non favorite scope
151− mouseClick(nonfavScopesListCategoryList.currentItem, 0, 0);
151+ mouseClick(nonfavScopesListCategoryList.currentItem);
152
152
153 // Check the bottom edge (manage dash) is disabled from temp scope
153 // Check the bottom edge (manage dash) is disabled from temp scope
154 var overviewDragHandle = findChild(dash, "overviewDragHandle");
154 var overviewDragHandle = findChild(dash, "overviewDragHandle");
@@ -165,7 +165,7 @@ Item {
165 // Go back
165 // Go back
166 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
166 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
167 var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
167 var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
168− mouseClick(backButton, 0, 0);
168+ mouseClick(backButton);
169
169
170 // Check temp scope is gone
170 // Check temp scope is gone
171 tryCompare(dashTempScopeItem, "x", dash.width);
171 tryCompare(dashTempScopeItem, "x", dash.width);
@@ -189,7 +189,7 @@ Item {
189 var scopesList = findChild(dash, "scopesList");
189 var scopesList = findChild(dash, "scopesList");
190 var scopesListPageHeader = findChild(scopesList, "pageHeader");
190 var scopesListPageHeader = findChild(scopesList, "pageHeader");
191 var searchButton = findChild(scopesListPageHeader, "search_header_button");
191 var searchButton = findChild(scopesListPageHeader, "search_header_button");
192− mouseClick(searchButton, 0, 0);
192+ mouseClick(searchButton);
193
193
194 // Type something
194 // Type something
195 keyClick(Qt.Key_H);
195 keyClick(Qt.Key_H);
@@ -201,7 +201,7 @@ Item {
201 var cardTempScope = findChild(dashCategorysearchA, "delegate2");
201 var cardTempScope = findChild(dashCategorysearchA, "delegate2");
202
202
203 waitForRendering(cardTempScope);
203 waitForRendering(cardTempScope);
204− mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
204+ mouseClick(cardTempScope);
205
205
206 // Check the bottom edge (overview) is disabled from temp scope
206 // Check the bottom edge (overview) is disabled from temp scope
207 var overviewDragHandle = findChild(dash, "overviewDragHandle");
207 var overviewDragHandle = findChild(dash, "overviewDragHandle");
@@ -218,7 +218,7 @@ Item {
218 // Go back
218 // Go back
219 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
219 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
220 var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
220 var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
221− mouseClick(backButton, 0, 0);
221+ mouseClick(backButton);
222
222
223 // Check temp scope is gone
223 // Check temp scope is gone
224 tryCompare(dashTempScopeItem, "x", dash.width);
224 tryCompare(dashTempScopeItem, "x", dash.width);
@@ -244,7 +244,7 @@ Item {
244 var scopesList = findChild(dash, "scopesList");
244 var scopesList = findChild(dash, "scopesList");
245 var scopesListPageHeader = findChild(scopesList, "pageHeader");
245 var scopesListPageHeader = findChild(scopesList, "pageHeader");
246 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
246 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
247− mouseClick(backButton, 0, 0);
247+ mouseClick(backButton);
248 tryCompare(bottomEdgeController, "progress", 0);
248 tryCompare(bottomEdgeController, "progress", 0);
249 }
249 }
250
250
@@ -272,7 +272,7 @@ Item {
272 var scopeLoader0 = findChild(dashContent, "scopeLoader0");
272 var scopeLoader0 = findChild(dashContent, "scopeLoader0");
273 var dashCategory0 = findChild(scopeLoader0, "dashCategory0");
273 var dashCategory0 = findChild(scopeLoader0, "dashCategory0");
274 var delegate0 = findChild(dashCategory0, "delegate0");
274 var delegate0 = findChild(dashCategory0, "delegate0");
275− mouseClick(delegate0, delegate0.width / 2, delegate0.height / 2);
275+ mouseClick(delegate0);
276
276
277 tryCompare(dashContent, "subPageShown", true)
277 tryCompare(dashContent, "subPageShown", true)
278 waitForRendering(dash);
278 waitForRendering(dash);
@@ -320,7 +320,7 @@ Item {
320 // Click on the store
320 // Click on the store
321 var scopesListPageHeader = findChild(scopesList, "pageHeader");
321 var scopesListPageHeader = findChild(scopesList, "pageHeader");
322 var searchButton = findChild(scopesListPageHeader, "store_header_button");
322 var searchButton = findChild(scopesListPageHeader, "store_header_button");
323− mouseClick(searchButton, 0, 0);
323+ mouseClick(searchButton);
324
324
325 spy.wait();
325 spy.wait();
326 compare(spy.signalArguments[0][0], "scope://com.canonical.scopes.clickstore");
326 compare(spy.signalArguments[0][0], "scope://com.canonical.scopes.clickstore");
@@ -345,9 +345,9 @@ Item {
345 // Enter edit mode
345 // Enter edit mode
346 var scopesList = findChild(dash, "scopesList");
346 var scopesList = findChild(dash, "scopesList");
347 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
347 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
348− mousePress(clickScope, 0, 0);
348+ mousePress(clickScope);
349 tryCompare(scopesList, "state", "edit");
349 tryCompare(scopesList, "state", "edit");
350− mouseRelease(clickScope, 0, 0);
350+ mouseRelease(clickScope);
351
351
352 var starArea = findChild(clickScope, "starArea");
352 var starArea = findChild(clickScope, "starArea");
353 touchFlick(starArea, 0, 0, 0, -units.gu(10));
353 touchFlick(starArea, 0, 0, 0, -units.gu(10));
@@ -356,8 +356,8 @@ Item {
356 var scopesList = findChild(dash, "scopesList");
356 var scopesList = findChild(dash, "scopesList");
357 var scopesListPageHeader = findChild(scopesList, "pageHeader");
357 var scopesListPageHeader = findChild(scopesList, "pageHeader");
358 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
358 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
359− mouseClick(backButton, 0, 0);
359+ mouseClick(backButton);
360− mouseClick(backButton, 0, 0);
360+ mouseClick(backButton);
361 tryCompare(bottomEdgeController, "progress", 0);
361 tryCompare(bottomEdgeController, "progress", 0);
362
362
363 tryCompare(dashContentList, "currentIndex", 0);
363 tryCompare(dashContentList, "currentIndex", 0);
@@ -387,9 +387,9 @@ Item {
387 // Enter edit mode
387 // Enter edit mode
388 var scopesList = findChild(dash, "scopesList");
388 var scopesList = findChild(dash, "scopesList");
389 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
389 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
390− mousePress(clickScope, 0, 0);
390+ mousePress(clickScope);
391 tryCompare(scopesList, "state", "edit");
391 tryCompare(scopesList, "state", "edit");
392− mouseRelease(clickScope, 0, 0);
392+ mouseRelease(clickScope);
393
393
394 var starArea = findChild(clickScope, "starArea");
394 var starArea = findChild(clickScope, "starArea");
395 touchFlick(starArea, 0, 0, 0, -units.gu(10));
395 touchFlick(starArea, 0, 0, 0, -units.gu(10));
@@ -401,12 +401,12 @@ Item {
401 var scopesList = findChild(dash, "scopesList");
401 var scopesList = findChild(dash, "scopesList");
402 var scopesListPageHeader = findChild(scopesList, "pageHeader");
402 var scopesListPageHeader = findChild(scopesList, "pageHeader");
403 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
403 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
404− mouseClick(backButton, 0, 0);
404+ mouseClick(backButton);
405
405
406 // Click on third scope
406 // Click on third scope
407 var mockScope5 = findChild(favScopesListCategoryList, "delegateMockScope5");
407 var mockScope5 = findChild(favScopesListCategoryList, "delegateMockScope5");
408 waitForRendering(mockScope5)
408 waitForRendering(mockScope5)
409− mouseClick(mockScope5, 0, 0);
409+ mouseClick(mockScope5);
410 tryCompare(bottomEdgeController, "progress", 0);
410 tryCompare(bottomEdgeController, "progress", 0);
411 tryCompare(dashContentList, "currentIndex", 2);
411 tryCompare(dashContentList, "currentIndex", 2);
412 compare(dashContentList.currentItem.scopeId, "MockScope5");
412 compare(dashContentList.currentItem.scopeId, "MockScope5");
tests/qmltests/Dash/tst_DashContent.qml+25−25
@@ -288,7 +288,7 @@ Item {
288 var dashNavigationButton = findChild(dashContentList.currentItem, "navigationButton");
288 var dashNavigationButton = findChild(dashContentList.currentItem, "navigationButton");
289 compare(dashNavigationButton.showList, false);
289 compare(dashNavigationButton.showList, false);
290 waitForRendering(dashNavigationButton);
290 waitForRendering(dashNavigationButton);
291− mouseClick(dashNavigationButton, dashNavigationButton.width / 2, dashNavigationButton.height / 2);
291+ mouseClick(dashNavigationButton);
292 compare(dashNavigationButton.showList, true);
292 compare(dashNavigationButton.showList, true);
293
293
294 var navigationListView = findChild(dashNavigationButton, "navigationListView");
294 var navigationListView = findChild(dashNavigationButton, "navigationListView");
@@ -304,30 +304,30 @@ Item {
304 compare(allButton.visible, false);
304 compare(allButton.visible, false);
305
305
306 var navigation = findChild(dashNavigationButton, "navigation0child3");
306 var navigation = findChild(dashNavigationButton, "navigation0child3");
307− mouseClick(navigation, 0, 0);
307+ mouseClick(navigation);
308 compare(dashNavigationButton.showList, false);
308 compare(dashNavigationButton.showList, false);
309 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle3");
309 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle3");
310 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
310 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
311
311
312− mouseClick(dashNavigationButton, 0, 0);
312+ mouseClick(dashNavigationButton);
313 compare(dashNavigationButton.showList, true);
313 compare(dashNavigationButton.showList, true);
314 waitForRendering(navigationListView);
314 waitForRendering(navigationListView);
315 waitForRendering(navigationListView.currentItem);
315 waitForRendering(navigationListView.currentItem);
316 compare(allButton.visible, true);
316 compare(allButton.visible, true);
317
317
318− mouseClick(allButton, 0, 0);
318+ mouseClick(allButton);
319 compare(dashNavigationButton.showList, false);
319 compare(dashNavigationButton.showList, false);
320 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
320 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
321 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
321 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
322
322
323− mouseClick(dashNavigationButton, 0, 0);
323+ mouseClick(dashNavigationButton);
324 compare(dashNavigationButton.showList, true);
324 compare(dashNavigationButton.showList, true);
325 waitForRendering(navigationListView);
325 waitForRendering(navigationListView);
326 waitForRendering(navigationListView.currentItem);
326 waitForRendering(navigationListView.currentItem);
327 compare(allButton.visible, false);
327 compare(allButton.visible, false);
328
328
329 navigation = findChild(dashNavigationButton, "navigation0child2");
329 navigation = findChild(dashNavigationButton, "navigation0child2");
330− mouseClick(navigation, 0, 0);
330+ mouseClick(navigation);
331 compare(dashNavigationButton.showList, true);
331 compare(dashNavigationButton.showList, true);
332 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
332 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
333 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
333 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
@@ -340,12 +340,12 @@ Item {
340
340
341 tryCompare(navigationListView, "contentX", navigationList1.x);
341 tryCompare(navigationListView, "contentX", navigationList1.x);
342 waitForRendering(navigationListView);
342 waitForRendering(navigationListView);
343− mouseClick(allButton, 0, 0);
343+ mouseClick(allButton);
344 compare(dashNavigationButton.showList, false);
344 compare(dashNavigationButton.showList, false);
345 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
345 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
346 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
346 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
347
347
348− mouseClick(dashNavigationButton, 0, 0);
348+ mouseClick(dashNavigationButton);
349 compare(dashNavigationButton.showList, true);
349 compare(dashNavigationButton.showList, true);
350 waitForRendering(navigationListView);
350 waitForRendering(navigationListView);
351 waitForRendering(navigationListView.currentItem);
351 waitForRendering(navigationListView.currentItem);
@@ -354,47 +354,47 @@ Item {
354
354
355 tryCompare(navigationList1.navigation, "loaded", true);
355 tryCompare(navigationList1.navigation, "loaded", true);
356 navigation = findChild(dashNavigationButton, "navigation1child2");
356 navigation = findChild(dashNavigationButton, "navigation1child2");
357− mouseClick(navigation, 0, 0);
357+ mouseClick(navigation);
358 compare(dashNavigationButton.showList, false);
358 compare(dashNavigationButton.showList, false);
359 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle22");
359 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle22");
360 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
360 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
361
361
362− mouseClick(dashNavigationButton, 0, 0);
362+ mouseClick(dashNavigationButton);
363 compare(dashNavigationButton.showList, true);
363 compare(dashNavigationButton.showList, true);
364 waitForRendering(navigationListView);
364 waitForRendering(navigationListView);
365 waitForRendering(navigationListView.currentItem);
365 waitForRendering(navigationListView.currentItem);
366
366
367 tryCompare(navigationList1.navigation, "loaded", true);
367 tryCompare(navigationList1.navigation, "loaded", true);
368 navigation = findChild(dashNavigationButton, "navigation1child3");
368 navigation = findChild(dashNavigationButton, "navigation1child3");
369− mouseClick(navigation, 0, 0);
369+ mouseClick(navigation);
370 compare(dashNavigationButton.showList, false);
370 compare(dashNavigationButton.showList, false);
371 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle23");
371 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle23");
372 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
372 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
373
373
374− mouseClick(dashNavigationButton, 0, 0);
374+ mouseClick(dashNavigationButton);
375 compare(dashNavigationButton.showList, true);
375 compare(dashNavigationButton.showList, true);
376 waitForRendering(navigationListView);
376 waitForRendering(navigationListView);
377 waitForRendering(navigationListView.currentItem);
377 waitForRendering(navigationListView.currentItem);
378− mouseClick(backButton, 0, 0);
378+ mouseClick(backButton);
379
379
380 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
380 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
381 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
381 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
382 compare(dashNavigationButton.showList, true);
382 compare(dashNavigationButton.showList, true);
383− mouseClick(dashNavigationButton, 0, 0);
383+ mouseClick(dashNavigationButton);
384 compare(dashNavigationButton.showList, false);
384 compare(dashNavigationButton.showList, false);
385
385
386− mouseClick(dashNavigationButton, 0, 0);
386+ mouseClick(dashNavigationButton);
387 compare(dashNavigationButton.showList, true);
387 compare(dashNavigationButton.showList, true);
388 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
388 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
389 navigation = findChild(dashNavigationButton, "navigation0child2");
389 navigation = findChild(dashNavigationButton, "navigation0child2");
390− mouseClick(navigation, 0, 0);
390+ mouseClick(navigation);
391 compare(dashNavigationButton.showList, true);
391 compare(dashNavigationButton.showList, true);
392 navigationList1 = findChild(dashNavigationButton, "navigation1");
392 navigationList1 = findChild(dashNavigationButton, "navigation1");
393 compare(navigationList1.navigation.loaded, false);
393 compare(navigationList1.navigation.loaded, false);
394 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
394 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
395 allButton = findChild(navigationList1, "allButton");
395 allButton = findChild(navigationList1, "allButton");
396 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
396 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
397− mouseClick(allButton, 0, 0);
397+ mouseClick(allButton);
398 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
398 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
399 }
399 }
400
400
@@ -408,7 +408,7 @@ Item {
408
408
409 compare(dashNavigationButton.showList, false);
409 compare(dashNavigationButton.showList, false);
410 waitForRendering(dashNavigationButton);
410 waitForRendering(dashNavigationButton);
411− mouseClick(dashNavigationButton, 0, 0);
411+ mouseClick(dashNavigationButton);
412 compare(dashNavigationButton.showList, true);
412 compare(dashNavigationButton.showList, true);
413
413
414 var navigationListView = findChild(dashNavigationButton, "navigationListView");
414 var navigationListView = findChild(dashNavigationButton, "navigationListView");
@@ -429,24 +429,24 @@ Item {
429 compare(backButton.visible, false);
429 compare(backButton.visible, false);
430
430
431 var navigation = findChild(dashNavigationButton, "navigation0child3");
431 var navigation = findChild(dashNavigationButton, "navigation0child3");
432− mouseClick(navigation, 0, 0);
432+ mouseClick(navigation);
433 compare(dashNavigationButton.showList, false);
433 compare(dashNavigationButton.showList, false);
434 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild3");
434 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild3");
435 tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
435 tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
436
436
437− mouseClick(dashNavigationButton, 0, 0);
437+ mouseClick(dashNavigationButton);
438 compare(dashNavigationButton.showList, true);
438 compare(dashNavigationButton.showList, true);
439 waitForRendering(navigationListView);
439 waitForRendering(navigationListView);
440 waitForRendering(navigationListView.currentItem);
440 waitForRendering(navigationListView.currentItem);
441 compare(allButton.visible, false);
441 compare(allButton.visible, false);
442
442
443 navigation = findChild(dashNavigationButton, "navigation0child2");
443 navigation = findChild(dashNavigationButton, "navigation0child2");
444− mouseClick(navigation, 0, 0);
444+ mouseClick(navigation);
445 compare(dashNavigationButton.showList, false);
445 compare(dashNavigationButton.showList, false);
446 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild2");
446 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild2");
447 tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
447 tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
448
448
449− mouseClick(dashNavigationButton, 0, 0);
449+ mouseClick(dashNavigationButton);
450 compare(dashNavigationButton.showList, true);
450 compare(dashNavigationButton.showList, true);
451 waitForRendering(navigationListView);
451 waitForRendering(navigationListView);
452 waitForRendering(navigationListView.currentItem);
452 waitForRendering(navigationListView.currentItem);
@@ -454,7 +454,7 @@ Item {
454
454
455 compare(navigationListView.count, 1, "There should be no second-level navigation");
455 compare(navigationListView.count, 1, "There should be no second-level navigation");
456
456
457− mouseClick(dashNavigationButton, 0, 0);
457+ mouseClick(dashNavigationButton);
458 compare(dashNavigationButton.showList, false);
458 compare(dashNavigationButton.showList, false);
459 }
459 }
460
460
@@ -474,7 +474,7 @@ Item {
474 compare(dashNavigationButton.showList, false);
474 compare(dashNavigationButton.showList, false);
475 compare(dashAltNavigationButton.showList, false);
475 compare(dashAltNavigationButton.showList, false);
476
476
477− mouseClick(dashNavigation, 0, 0);
477+ mouseClick(dashNavigation);
478 compare(dashNavigationButton.showList, false);
478 compare(dashNavigationButton.showList, false);
479 compare(dashAltNavigationButton.showList, true);
479 compare(dashAltNavigationButton.showList, true);
480
480
@@ -500,7 +500,7 @@ Item {
500 navigationListView = findChild(dashNavigationButton, "navigationListView");
500 navigationListView = findChild(dashNavigationButton, "navigationListView");
501 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
501 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
502
502
503− mouseClick(dashNavigation, 0, 0);
503+ mouseClick(dashNavigation);
504 compare(dashNavigationButton.showList, false);
504 compare(dashNavigationButton.showList, false);
505 compare(dashAltNavigationButton.showList, false);
505 compare(dashAltNavigationButton.showList, false);
506 }
506 }
tests/qmltests/Dash/tst_GenericScopeView.qml+26−26
@@ -163,12 +163,12 @@ Item {
163 verify(!category.expanded);
163 verify(!category.expanded);
164
164
165 var initialHeight = category.height;
165 var initialHeight = category.height;
166− mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
166+ mouseClick(seeAll);
167 verify(category.expanded);
167 verify(category.expanded);
168 tryCompare(category, "height", category.item.expandedHeight + seeAll.height);
168 tryCompare(category, "height", category.item.expandedHeight + seeAll.height);
169
169
170 waitForRendering(seeAll);
170 waitForRendering(seeAll);
171− mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
171+ mouseClick(seeAll);
172 verify(!category.expanded);
172 verify(!category.expanded);
173 }
173 }
174
174
@@ -186,17 +186,17 @@ Item {
186 verify(category2.expandable);
186 verify(category2.expandable);
187 verify(!category2.expanded);
187 verify(!category2.expanded);
188
188
189− mouseClick(seeAll2, seeAll2.width / 2, seeAll2.height / 2);
189+ mouseClick(seeAll2);
190 tryCompare(category2, "expanded", true);
190 tryCompare(category2, "expanded", true);
191
191
192 categoryListView.positionAtBeginning();
192 categoryListView.positionAtBeginning();
193
193
194 var category0 = findChild(genericScopeView, "dashCategory0")
194 var category0 = findChild(genericScopeView, "dashCategory0")
195 var seeAll0 = findChild(category0, "seeAll")
195 var seeAll0 = findChild(category0, "seeAll")
196− mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
196+ mouseClick(seeAll0);
197 tryCompare(category0, "expanded", true);
197 tryCompare(category0, "expanded", true);
198 tryCompare(category2, "expanded", false);
198 tryCompare(category2, "expanded", false);
199− mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
199+ mouseClick(seeAll0);
200 tryCompare(category0, "expanded", false);
200 tryCompare(category0, "expanded", false);
201 tryCompare(category2, "expanded", false);
201 tryCompare(category2, "expanded", false);
202 }
202 }
@@ -208,7 +208,7 @@ Item {
208 spy.target = genericScopeView.scope;
208 spy.target = genericScopeView.scope;
209 spy.signalName = "performQuery";
209 spy.signalName = "performQuery";
210
210
211− mouseClick(header, header.width / 2, header.height / 2);
211+ mouseClick(header);
212
212
213 spy.wait();
213 spy.wait();
214 compare(spy.signalArguments[0][0], genericScopeView.scope.categories.data(1, Categories.RoleHeaderLink));
214 compare(spy.signalArguments[0][0], genericScopeView.scope.categories.data(1, Categories.RoleHeaderLink));
@@ -248,13 +248,13 @@ Item {
248 categoryListView.contentY = units.gu(20);
248 categoryListView.contentY = units.gu(20);
249 var seeAll = findChild(category, "seeAll");
249 var seeAll = findChild(category, "seeAll");
250 var floatingSeeLess = findChild(genericScopeView, "floatingSeeLess");
250 var floatingSeeLess = findChild(genericScopeView, "floatingSeeLess");
251− mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
251+ mouseClick(seeAll);
252 tryCompare(category, "expanded", true);
252 tryCompare(category, "expanded", true);
253 tryCompareFunction(function() {
253 tryCompareFunction(function() {
254 return category.item.height + floatingSeeLess.height ==
254 return category.item.height + floatingSeeLess.height ==
255 genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd;
255 genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd;
256 }, true);
256 }, true);
257− mouseClick(floatingSeeLess, floatingSeeLess.width / 2, floatingSeeLess.height / 2);
257+ mouseClick(floatingSeeLess);
258 tryCompare(category, "expanded", false);
258 tryCompare(category, "expanded", false);
259 }
259 }
260
260
@@ -295,7 +295,7 @@ Item {
295 true);
295 true);
296 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
296 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
297 waitForRendering(tile);
297 waitForRendering(tile);
298− mouseClick(tile, tile.width / 2, tile.height / 2);
298+ mouseClick(tile);
299 tryCompare(testCase.subPageLoader, "open", true);
299 tryCompare(testCase.subPageLoader, "open", true);
300 tryCompare(testCase.subPageLoader, "x", 0);
300 tryCompare(testCase.subPageLoader, "x", 0);
301 tryCompare(findChild(genericScopeView, "categoryListView"), "visible", false);
301 tryCompare(findChild(genericScopeView, "categoryListView"), "visible", false);
@@ -340,15 +340,15 @@ Item {
340 tryCompare(testCase.subPageLoader, "open", false);
340 tryCompare(testCase.subPageLoader, "open", false);
341 tryCompare(testCase.subPageLoader, "visible", false);
341 tryCompare(testCase.subPageLoader, "visible", false);
342
342
343− mouseClick(tile, tile.width / 2, tile.height / 2);
343+ mouseClick(tile);
344
344
345 tryCompare(testCase.subPageLoader, "open", false);
345 tryCompare(testCase.subPageLoader, "open", false);
346 tryCompare(testCase.subPageLoader, "visible", false);
346 tryCompare(testCase.subPageLoader, "visible", false);
347
347
348− mousePress(tile, tile.width / 2, tile.height / 2);
348+ mousePress(tile);
349 tryCompare(testCase.subPageLoader, "open", false);
349 tryCompare(testCase.subPageLoader, "open", false);
350 tryCompare(testCase.subPageLoader, "visible", false);
350 tryCompare(testCase.subPageLoader, "visible", false);
351− mouseRelease(tile, tile.width / 2, tile.height / 2);
351+ mouseRelease(tile);
352 }
352 }
353
353
354 function test_showPreviewCarousel() {
354 function test_showPreviewCarousel() {
@@ -359,18 +359,18 @@ Item {
359 var tile = findChild(category, "carouselDelegate1");
359 var tile = findChild(category, "carouselDelegate1");
360 verify(tile, "Could not find delegate");
360 verify(tile, "Could not find delegate");
361
361
362− mouseClick(tile, tile.width / 2, tile.height / 2);
362+ mouseClick(tile);
363 tryCompare(tile, "explicitlyScaled", true);
363 tryCompare(tile, "explicitlyScaled", true);
364− mouseClick(tile, tile.width / 2, tile.height / 2);
364+ mouseClick(tile);
365 tryCompare(testCase.subPageLoader, "open", true);
365 tryCompare(testCase.subPageLoader, "open", true);
366 tryCompare(testCase.subPageLoader, "x", 0);
366 tryCompare(testCase.subPageLoader, "x", 0);
367
367
368 closePreview();
368 closePreview();
369
369
370− mousePress(tile, tile.width / 2, tile.height / 2);
370+ mousePress(tile);
371 tryCompare(testCase.subPageLoader, "open", true);
371 tryCompare(testCase.subPageLoader, "open", true);
372 tryCompare(testCase.subPageLoader, "x", 0);
372 tryCompare(testCase.subPageLoader, "x", 0);
373− mouseRelease(tile, tile.width / 2, tile.height / 2);
373+ mouseRelease(tile);
374
374
375 closePreview();
375 closePreview();
376 }
376 }
@@ -383,16 +383,16 @@ Item {
383 var tile = findChild(category, "delegate1");
383 var tile = findChild(category, "delegate1");
384 verify(tile, "Could not find delegate");
384 verify(tile, "Could not find delegate");
385
385
386− mouseClick(tile, tile.width / 2, tile.height / 2);
386+ mouseClick(tile);
387 tryCompare(testCase.subPageLoader, "open", true);
387 tryCompare(testCase.subPageLoader, "open", true);
388 tryCompare(testCase.subPageLoader, "x", 0);
388 tryCompare(testCase.subPageLoader, "x", 0);
389
389
390 closePreview();
390 closePreview();
391
391
392− mousePress(tile, tile.width / 2, tile.height / 2);
392+ mousePress(tile);
393 tryCompare(testCase.subPageLoader, "open", true);
393 tryCompare(testCase.subPageLoader, "open", true);
394 tryCompare(testCase.subPageLoader, "x", 0);
394 tryCompare(testCase.subPageLoader, "x", 0);
395− mouseRelease(tile, tile.width / 2, tile.height / 2);
395+ mouseRelease(tile);
396
396
397 closePreview();
397 closePreview();
398 }
398 }
@@ -429,7 +429,7 @@ Item {
429 tryCompare(testCase.subPageLoader, "open", false);
429 tryCompare(testCase.subPageLoader, "open", false);
430 tryCompare(testCase.subPageLoader, "visible", false);
430 tryCompare(testCase.subPageLoader, "visible", false);
431 var settings = findChild(innerHeader, "settings_header_button");
431 var settings = findChild(innerHeader, "settings_header_button");
432− mouseClick(settings, settings.width / 2, settings.height / 2);
432+ mouseClick(settings);
433 tryCompare(testCase.subPageLoader, "open", true);
433 tryCompare(testCase.subPageLoader, "open", true);
434 tryCompareFunction(function() { return (String(subPageLoader.source)).indexOf("ScopeSettingsPage.qml") != -1; }, true);
434 tryCompareFunction(function() { return (String(subPageLoader.source)).indexOf("ScopeSettingsPage.qml") != -1; }, true);
435 tryCompare(genericScopeView, "subPageShown", true);
435 tryCompare(genericScopeView, "subPageShown", true);
@@ -496,7 +496,7 @@ Item {
496 verify(category0.expandable);
496 verify(category0.expandable);
497 verify(!category0.expanded);
497 verify(!category0.expanded);
498
498
499− mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
499+ mouseClick(seeAll0);
500 verify(category0.expanded);
500 verify(category0.expanded);
501 tryCompare(category0, "height", category0.item.expandedHeight + seeAll0.height);
501 tryCompare(category0, "height", category0.item.expandedHeight + seeAll0.height);
502 tryCompare(genericScopeView.categoryView, "contentY", units.gu(14));
502 tryCompare(genericScopeView.categoryView, "contentY", units.gu(14));
@@ -509,7 +509,7 @@ Item {
509 verify(category1.expandable);
509 verify(category1.expandable);
510 verify(!category1.expanded);
510 verify(!category1.expanded);
511
511
512− mouseClick(seeAll1, seeAll1.width / 2, seeAll1.height / 2);
512+ mouseClick(seeAll1);
513 verify(!category0.expanded);
513 verify(!category0.expanded);
514 verify(category1.expanded);
514 verify(category1.expanded);
515 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
515 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
@@ -539,7 +539,7 @@ Item {
539 verify(category0.expandable);
539 verify(category0.expandable);
540 verify(!category0.expanded);
540 verify(!category0.expanded);
541
541
542− mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
542+ mouseClick(seeAll0);
543 verify(category0.expanded);
543 verify(category0.expanded);
544 tryCompare(category0, "height", category0.item.expandedHeight + seeAll0.height);
544 tryCompare(category0, "height", category0.item.expandedHeight + seeAll0.height);
545
545
@@ -550,7 +550,7 @@ Item {
550 verify(category1.expandable);
550 verify(category1.expandable);
551 verify(!category1.expanded);
551 verify(!category1.expanded);
552
552
553− mouseClick(seeAll1, seeAll1.width / 2, seeAll1.height / 2);
553+ mouseClick(seeAll1);
554 verify(!category0.expanded);
554 verify(!category0.expanded);
555 verify(category1.expanded);
555 verify(category1.expanded);
556 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
556 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
@@ -578,7 +578,7 @@ Item {
578 expectFail("Apps", "Click scope should not have a favorite button");
578 expectFail("Apps", "Click scope should not have a favorite button");
579 var favoriteAction = findChild(innerHeader, "favorite_header_button");
579 var favoriteAction = findChild(innerHeader, "favorite_header_button");
580 verify(favoriteAction, "Could not find the favorite action.");
580 verify(favoriteAction, "Could not find the favorite action.");
581− mouseClick(favoriteAction, favoriteAction.width / 2, favoriteAction.height / 2);
581+ mouseClick(favoriteAction);
582
582
583 tryCompare(genericScopeView.scope, "favorite", !data.favorite);
583 tryCompare(genericScopeView.scope, "favorite", !data.favorite);
584
584
@@ -629,7 +629,7 @@ Item {
629 var touchdown = findChild(item0, "touchdown");
629 var touchdown = findChild(item0, "touchdown");
630
630
631 compare(touchdown.visible, false);
631 compare(touchdown.visible, false);
632− mouseClick(item0, item0.width / 2, item0.height / 2);
632+ mouseClick(item0);
633 compare(touchdown.visible, false);
633 compare(touchdown.visible, false);
634
634
635 cardTool.template["non-interactive"] = false;
635 cardTool.template["non-interactive"] = false;
tests/qmltests/Dash/tst_PageHeader.qml+1−1
@@ -157,7 +157,7 @@ Item {
157 var recentSearches = findChild(headerContainer.popover, "recentSearches");
157 var recentSearches = findChild(headerContainer.popover, "recentSearches");
158 verify(recentSearches, "Could not find recent searches in the popover");
158 verify(recentSearches, "Could not find recent searches in the popover");
159 waitForRendering(recentSearches);
159 waitForRendering(recentSearches);
160− mouseClick(recentSearches.itemAt(0), 0, 0);
160+ mouseClick(recentSearches.itemAt(0));
161
161
162 compare(pageHeader.searchQuery, "Search2");
162 compare(pageHeader.searchQuery, "Search2");
163 tryCompareFunction(function() { return headerContainer.popover === null; }, true);
163 tryCompareFunction(function() { return headerContainer.popover === null; }, true);
tests/qmltests/Dash/tst_PreviewListView.qml+2−2
@@ -73,7 +73,7 @@ Rectangle {
73
73
74 function test_notProcessing() {
74 function test_notProcessing() {
75 expectFail("", "processingMouseArea should not receive the click.");
75 expectFail("", "processingMouseArea should not receive the click.");
76− mouseClick(listView, listView.width / 2, listView.height / 2);
76+ mouseClick(listView);
77 clickedSpy.wait();
77 clickedSpy.wait();
78 }
78 }
79
79
@@ -83,7 +83,7 @@ Rectangle {
83
83
84 tryCompare(listView, "processing", true);
84 tryCompare(listView, "processing", true);
85
85
86− mouseClick(listView, listView.width / 2, listView.height / 2);
86+ mouseClick(listView);
87 clickedSpy.wait();
87 clickedSpy.wait();
88 }
88 }
89
89
tests/qmltests/Launcher/tst_Launcher.qml+8−8
@@ -154,7 +154,7 @@ Item {
154 dragLauncherIntoView()
154 dragLauncherIntoView()
155
155
156 // tapping on the center of the screen should dismiss the launcher
156 // tapping on the center of the screen should dismiss the launcher
157− mouseClick(launcher, launcher.width/2, launcher.height/2)
157+ mouseClick(launcher)
158
158
159 // should eventually get fully retracted (hidden)
159 // should eventually get fully retracted (hidden)
160 tryCompare(panel, "x", -launcher.panelWidth, 1000)
160 tryCompare(panel, "x", -launcher.panelWidth, 1000)
@@ -175,7 +175,7 @@ Item {
175
175
176 verify(appIcon != undefined)
176 verify(appIcon != undefined)
177
177
178− mouseClick(appIcon, appIcon.width/2, appIcon.height/2)
178+ mouseClick(appIcon)
179
179
180 tryCompare(launcher, "lastSelectedApplication",
180 tryCompare(launcher, "lastSelectedApplication",
181 "dialer-app")
181 "dialer-app")
@@ -194,7 +194,7 @@ Item {
194 var dashIcon = findChild(launcher, "dashItem")
194 var dashIcon = findChild(launcher, "dashItem")
195 verify(dashIcon != undefined)
195 verify(dashIcon != undefined)
196
196
197− mouseClick(dashIcon, dashIcon.width/2, dashIcon.height/2)
197+ mouseClick(dashIcon)
198
198
199 tryCompare(launcher, "showDashHome_count", 1)
199 tryCompare(launcher, "showDashHome_count", 1)
200
200
@@ -413,7 +413,7 @@ Item {
413 compare(quickListShape.visible, false)
413 compare(quickListShape.visible, false)
414
414
415 // Doing longpress
415 // Doing longpress
416− mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2)
416+ mousePress(draggedItem)
417 tryCompare(fakeDragItem, "visible", true) // Wait longpress happening
417 tryCompare(fakeDragItem, "visible", true) // Wait longpress happening
418 tryCompare(quickListShape, "visible", true)
418 tryCompare(quickListShape, "visible", true)
419
419
@@ -448,7 +448,7 @@ Item {
448 }
448 }
449
449
450 // Doing longpress
450 // Doing longpress
451− mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2);
451+ mousePress(draggedItem);
452 tryCompare(quickListShape, "opacity", 0.96);
452 tryCompare(quickListShape, "opacity", 0.96);
453 mouseRelease(draggedItem);
453 mouseRelease(draggedItem);
454
454
@@ -481,7 +481,7 @@ Item {
481 tryCompare(quickListShape, "visible", false)
481 tryCompare(quickListShape, "visible", false)
482
482
483 // Doing longpress
483 // Doing longpress
484− mousePress(clickedItem, clickedItem.width / 2, clickedItem.height / 2)
484+ mousePress(clickedItem)
485 tryCompare(clickedItem, "itemOpacity", 0) // Wait for longpress to happen
485 tryCompare(clickedItem, "itemOpacity", 0) // Wait for longpress to happen
486 verify(quickListShape.visible, "QuickList must be visible")
486 verify(quickListShape.visible, "QuickList must be visible")
487
487
@@ -492,7 +492,7 @@ Item {
492 signalSpy.clear();
492 signalSpy.clear();
493 signalSpy.signalName = "quickListTriggered"
493 signalSpy.signalName = "quickListTriggered"
494
494
495− mouseClick(quickListEntry, quickListEntry.width / 2, quickListEntry.height / 2)
495+ mouseClick(quickListEntry)
496
496
497 if (data.clickable) {
497 if (data.clickable) {
498 // QuickList needs to be closed when some clickable item is clicked
498 // QuickList needs to be closed when some clickable item is clicked
@@ -524,7 +524,7 @@ Item {
524 tryCompare(quickList, "state", "")
524 tryCompare(quickList, "state", "")
525
525
526 // Doing longpress
526 // Doing longpress
527− mousePress(clickedItem, clickedItem.width / 2, clickedItem.height / 2)
527+ mousePress(clickedItem)
528 tryCompare(clickedItem, "itemOpacity", 0) // Wait for longpress to happen
528 tryCompare(clickedItem, "itemOpacity", 0) // Wait for longpress to happen
529 verify(quickList, "state", "open")
529 verify(quickList, "state", "open")
530
530
tests/qmltests/Notifications/tst_Notifications.qml+6−6
@@ -547,7 +547,7 @@ Item {
547 compare(valueLabel.visible, data.valueLabelVisible, "value-label visibility is incorrect")
547 compare(valueLabel.visible, data.valueLabelVisible, "value-label visibility is incorrect")
548
548
549 // test input does not fall through
549 // test input does not fall through
550− mouseClick(notification, notification.width / 2, notification.height / 2)
550+ mouseClick(notification)
551 if(data.type == Notification.Interactive) {
551 if(data.type == Notification.Interactive) {
552 actionSpy.wait()
552 actionSpy.wait()
553 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
553 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
@@ -568,7 +568,7 @@ Item {
568
568
569 // only test the left/cancel-button if two actions have been passed in
569 // only test the left/cancel-button if two actions have been passed in
570 if (data.actions.length == 2) {
570 if (data.actions.length == 2) {
571− tryCompareFunction(function() { mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2); return actionSpy.signalArguments.length > 0; }, true);
571+ tryCompareFunction(function() { mouseClick(buttonCancel); return actionSpy.signalArguments.length > 0; }, true);
572 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
572 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
573 actionSpy.clear()
573 actionSpy.clear()
574 }
574 }
@@ -577,7 +577,7 @@ Item {
577 verify(buttonAccept.color === data.buttonTinted ? "#3fb24f" : "#dddddd", "button has the wrong color-tint")
577 verify(buttonAccept.color === data.buttonTinted ? "#3fb24f" : "#dddddd", "button has the wrong color-tint")
578
578
579 // click the positive/right button
579 // click the positive/right button
580− tryCompareFunction(function() { mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2); return actionSpy.signalArguments.length > 0; }, true);
580+ tryCompareFunction(function() { mouseClick(buttonAccept); return actionSpy.signalArguments.length > 0; }, true);
581 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
581 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
582 actionSpy.clear()
582 actionSpy.clear()
583 waitForRendering (notification)
583 waitForRendering (notification)
@@ -592,19 +592,19 @@ Item {
592
592
593 // try clicking on choices in expanded comboList
593 // try clicking on choices in expanded comboList
594 var choiceButton1 = findChild(notification, "notify_button3")
594 var choiceButton1 = findChild(notification, "notify_button3")
595− tryCompareFunction(function() { mouseClick(choiceButton1, choiceButton1.width / 2, choiceButton1.height / 2); return actionSpy.signalArguments.length > 0; }, true);
595+ tryCompareFunction(function() { mouseClick(choiceButton1); return actionSpy.signalArguments.length > 0; }, true);
596 compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
596 compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
597 actionSpy.clear()
597 actionSpy.clear()
598
598
599 var choiceButton2 = findChild(notification, "notify_button4")
599 var choiceButton2 = findChild(notification, "notify_button4")
600− tryCompareFunction(function() { mouseClick(choiceButton2, choiceButton2.width / 2, choiceButton2.height / 2); return actionSpy.signalArguments.length > 0; }, true);
600+ tryCompareFunction(function() { mouseClick(choiceButton2); return actionSpy.signalArguments.length > 0; }, true);
601 compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
601 compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
602 actionSpy.clear()
602 actionSpy.clear()
603
603
604 // click to collapse
604 // click to collapse
605 //tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
605 //tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
606 } else {
606 } else {
607− mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
607+ mouseClick(buttonCancel)
608 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
608 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
609 }
609 }
610 }
610 }
tests/qmltests/Notifications/tst_OptionToggle.qml+7−7
@@ -223,7 +223,7 @@ Row {
223 }
223 }
224
224
225 // test input does not fall through
225 // test input does not fall through
226− mouseClick(notification, notification.width / 2, notification.height / 2)
226+ mouseClick(notification)
227 if(data.type == Notification.Interactive) {
227 if(data.type == Notification.Interactive) {
228 actionSpy.wait()
228 actionSpy.wait()
229 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
229 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
@@ -244,7 +244,7 @@ Row {
244
244
245 // only test the left/cancel-button if two actions have been passed in
245 // only test the left/cancel-button if two actions have been passed in
246 if (data.actions.length == 2) {
246 if (data.actions.length == 2) {
247− tryCompareFunction(function() { mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2); return actionSpy.signalArguments.length > 0; }, true);
247+ tryCompareFunction(function() { mouseClick(buttonCancel); return actionSpy.signalArguments.length > 0; }, true);
248 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
248 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
249 actionSpy.clear()
249 actionSpy.clear()
250 }
250 }
@@ -253,7 +253,7 @@ Row {
253 verify(buttonAccept.color === data.buttonTinted ? "#3fb24f" : "#dddddd", "button has the wrong color-tint")
253 verify(buttonAccept.color === data.buttonTinted ? "#3fb24f" : "#dddddd", "button has the wrong color-tint")
254
254
255 // click the positive/right button
255 // click the positive/right button
256− tryCompareFunction(function() { mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2); return actionSpy.signalArguments.length > 0; }, true);
256+ tryCompareFunction(function() { mouseClick(buttonAccept); return actionSpy.signalArguments.length > 0; }, true);
257 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
257 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
258 actionSpy.clear()
258 actionSpy.clear()
259 waitForRendering(notification)
259 waitForRendering(notification)
@@ -264,20 +264,20 @@ Row {
264 tryCompareFunction(function() { return optionToggle.expanded == false; }, true);
264 tryCompareFunction(function() { return optionToggle.expanded == false; }, true);
265
265
266 // click to expand
266 // click to expand
267− tryCompareFunction(function() { mouseClick(optionToggle, optionToggle.width / 2, optionToggle.height / 2); return optionToggle.expanded == true; }, true);
267+ tryCompareFunction(function() { mouseClick(optionToggle); return optionToggle.expanded == true; }, true);
268
268
269 // try clicking on choices in expanded comboList
269 // try clicking on choices in expanded comboList
270 var choiceButton1 = findChild(notification, "notify_button3")
270 var choiceButton1 = findChild(notification, "notify_button3")
271− tryCompareFunction(function() { mouseClick(choiceButton1, choiceButton1.width / 2, choiceButton1.height / 2); return actionSpy.signalArguments.length > 0; }, true);
271+ tryCompareFunction(function() { mouseClick(choiceButton1); return actionSpy.signalArguments.length > 0; }, true);
272 compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
272 compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
273 actionSpy.clear()
273 actionSpy.clear()
274
274
275 var choiceButton2 = findChild(notification, "notify_button4")
275 var choiceButton2 = findChild(notification, "notify_button4")
276− tryCompareFunction(function() { mouseClick(choiceButton2, choiceButton2.width / 2, choiceButton2.height / 2); return actionSpy.signalArguments.length > 0; }, true);
276+ tryCompareFunction(function() { mouseClick(choiceButton2); return actionSpy.signalArguments.length > 0; }, true);
277 compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
277 compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
278 actionSpy.clear()
278 actionSpy.clear()
279 } else {
279 } else {
280− mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
280+ mouseClick(buttonCancel)
281 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
281 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
282 }
282 }
283 }
283 }
tests/qmltests/Notifications/tst_SwipeToAct.qml+1−1
@@ -240,7 +240,7 @@ Item {
240 }
240 }
241
241
242 // test input does not fall through
242 // test input does not fall through
243− mouseClick(notification, notification.width / 2, notification.height / 2)
243+ mouseClick(notification)
244 if(data.type == Notification.Interactive) {
244 if(data.type == Notification.Interactive) {
245 actionSpy.wait()
245 actionSpy.wait()
246 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
246 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml+2−2
@@ -214,7 +214,7 @@ Row {
214
214
215 // click/tap on each snap-decision and verify only one is in expanded-state at any time
215 // click/tap on each snap-decision and verify only one is in expanded-state at any time
216 for (var index = 0; index < snap_decision.length; index++) {
216 for (var index = 0; index < snap_decision.length; index++) {
217− mouseClick(snap_decision[index], snap_decision[index].width / 2, snap_decision[index].height / 2)
217+ mouseClick(snap_decision[index])
218 for (var kindex = 0; kindex < snap_decision.length; kindex++) {
218 for (var kindex = 0; kindex < snap_decision.length; kindex++) {
219 if (kindex == index) {
219 if (kindex == index) {
220 compare(snap_decision[kindex].state, "expanded", "state of "+ kindex + ".snap-decision is not expanded");
220 compare(snap_decision[kindex].state, "expanded", "state of "+ kindex + ".snap-decision is not expanded");
@@ -227,7 +227,7 @@ Row {
227 // remove top-most and verify one of the remaining ones is still getting expanded
227 // remove top-most and verify one of the remaining ones is still getting expanded
228
228
229 // make first snap-decision expand
229 // make first snap-decision expand
230− mouseClick(snap_decision[0], snap_decision[0].width / 2, snap_decision[0].height / 2);
230+ mouseClick(snap_decision[0]);
231
231
232 for (var index = 1; index < snap_decision.length; index++) {
232 for (var index = 1; index < snap_decision.length; index++) {
233 removeTopMostNotification();
233 removeTopMostNotification();
tests/qmltests/Panel/tst_IndicatorsBar.qml+1−1
@@ -197,7 +197,7 @@ IndicatorTest {
197 if (indicatorsBar.mapFromItem(dataItem, dataItem.width/2, dataItem.height/2).x < 0) {
197 if (indicatorsBar.mapFromItem(dataItem, dataItem.width/2, dataItem.height/2).x < 0) {
198 skip("Out of bounds");
198 skip("Out of bounds");
199 }
199 }
200− mouseClick(dataItem, dataItem.width/2, dataItem.height/2);
200+ mouseClick(dataItem);
201 verify(dataItem.selected === true);
201 verify(dataItem.selected === true);
202 }
202 }
203
203
tests/qmltests/tst_Shell.qml+2−2
@@ -245,7 +245,7 @@ Item {
245
245
246 // Clicking the button should dismiss the notification and return focus
246 // Clicking the button should dismiss the notification and return focus
247 var buttonAccept = findChild(notification, "notify_button0");
247 var buttonAccept = findChild(notification, "notify_button0");
248− mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2);
248+ mouseClick(buttonAccept);
249
249
250 // Make sure we're back to normal
250 // Make sure we're back to normal
251 tryCompare(app.session.surface, "activeFocus", true);
251 tryCompare(app.session.surface, "activeFocus", true);
@@ -463,7 +463,7 @@ Item {
463 var launcher = findChild(shell, "launcherPanel")
463 var launcher = findChild(shell, "launcherPanel")
464 tryCompareFunction(function() {return launcher.x === 0 || launcher.x === -launcher.width;}, true);
464 tryCompareFunction(function() {return launcher.x === 0 || launcher.x === -launcher.width;}, true);
465 if (launcher.x === 0) {
465 if (launcher.x === 0) {
466− mouseClick(shell, shell.width / 2, shell.height / 2)
466+ mouseClick(shell)
467 }
467 }
468 tryCompare(launcher, "x", -launcher.width)
468 tryCompare(launcher, "x", -launcher.width)
469
469
tests/qmltests/tst_TabletShell.qml+1−1
@@ -211,7 +211,7 @@ Row {
211 tryCompare(passwordMouseArea, "enabled", isButton)
211 tryCompare(passwordMouseArea, "enabled", isButton)
212
212
213 var passwordInput = findChild(shell, "passwordInput")
213 var passwordInput = findChild(shell, "passwordInput")
214− mouseClick(passwordInput, passwordInput.width / 2, passwordInput.height / 2)
214+ mouseClick(passwordInput)
215 }
215 }
216
216
217 function confirmLoggedIn(loggedIn) {
217 function confirmLoggedIn(loggedIn) {
tests/utils/modules/Unity/Test/UnityTestCase.qml+61
@@ -37,6 +37,67 @@ TestCase {
37 this.getCurrentTimeMs = function() {return this.currentTimeMs}
37 this.getCurrentTimeMs = function() {return this.currentTimeMs}
38 }
38 }
39
39
40+ function mouseClick(item, x, y, button, modifiers, delay) {
41+ if (button === undefined)
42+ button = Qt.LeftButton;
43+ if (modifiers === undefined)
44+ modifiers = Qt.NoModifier;
45+ if (delay == undefined)
46+ delay = -1;
47+ if (x == undefined)
48+ x = item.width / 2;
49+ if (y == undefined)
50+ y = item.height / 2;
51+ if (qtest_events.mouseClick(item, x, y, button, modifiers, delay))
52+ qtest_fail("window not shown", 2);
53+ }
54+
55+ function mouseDoubleClick(item, x, y, button, modifiers, delay) {
56+ if (button === undefined)
57+ button = Qt.LeftButton
58+ if (modifiers === undefined)
59+ modifiers = Qt.NoModifier
60+ if (delay == undefined)
61+ delay = -1
62+ if (x == undefined)
63+ x = item.width / 2;
64+ if (y == undefined)
65+ y = item.height / 2;
66+ if (!qtest_events.mouseDoubleClick(item, x, y, button, modifiers, delay))
67+ qtest_fail("window not shown", 2)
68+ }
69+
70+ function mousePress(item, x, y, button, modifiers, delay) {
71+ if (button === undefined)
72+ button = Qt.LeftButton
73+ if (modifiers === undefined)
74+ modifiers = Qt.NoModifier
75+ if (delay == undefined)
76+ delay = -1
77+ if (x == undefined)
78+ x = item.width / 2;
79+ if (y == undefined)
80+ y = item.height / 2;
81+ if (!qtest_events.mousePress(item, x, y, button, modifiers, delay))
82+ qtest_fail("window not shown", 2)
83+ }
84+
85+ function mouseRelease(item, x, y, button, modifiers, delay) {
86+ if (button === undefined)
87+ button = Qt.LeftButton
88+ if (modifiers === undefined)
89+ modifiers = Qt.NoModifier
90+ if (delay == undefined)
91+ delay = -1
92+ if (x == undefined)
93+ x = item.width / 2;
94+ if (y == undefined)
95+ y = item.height / 2;
96+ if (!qtest_events.mouseRelease(item, x, y, button, modifiers, delay))
97+ qtest_fail("window not shown", 2)
98+ }
99+
100+
40 // Flickable won't recognise a single mouse move as dragging the flickable.
101 // Flickable won't recognise a single mouse move as dragging the flickable.
41 // Use 5 steps because it's what
102 // Use 5 steps because it's what
42 // Qt uses in QQuickViewTestUtil::flick
103 // Qt uses in QQuickViewTestUtil::flick