on xenial help sign in
Update tests
cb02036Daniel d'Andrada
tests/qmltests/Panel/tst_IndicatorsMenu.qml+3−3
@@ -174,7 +174,7 @@ IndicatorTest {
174 // and expose the header
174 // and expose the header
175 function test_hint() {
175 function test_hint() {
176 var indicatorItem = get_indicator_item(0);
176 var indicatorItem = get_indicator_item(0);
177− var mappedPosition = root.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
177+ var mappedPosition = indicatorsMenu.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
178
178
179 touchPress(indicatorsMenu, mappedPosition.x, indicatorsMenu.minimizedPanelHeight / 2);
179 touchPress(indicatorsMenu, mappedPosition.x, indicatorsMenu.minimizedPanelHeight / 2);
180
180
@@ -195,7 +195,7 @@ IndicatorTest {
195 for (var i = 0; i < root.originalModelData.length; i++) {
195 for (var i = 0; i < root.originalModelData.length; i++) {
196 var indicatorItem = get_indicator_item(i);
196 var indicatorItem = get_indicator_item(i);
197
197
198− var mappedPosition = root.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
198+ var mappedPosition = indicatorsMenu.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
199
199
200 touchFlick(indicatorsMenu,
200 touchFlick(indicatorsMenu,
201 mappedPosition.x, mappedPosition.y,
201 mappedPosition.x, mappedPosition.y,
@@ -227,7 +227,7 @@ IndicatorTest {
227
227
228 // Get the first indicator
228 // Get the first indicator
229 var firstItem = get_indicator_item(0);
229 var firstItem = get_indicator_item(0);
230− var firstItemMappedPosition = root.mapFromItem(firstItem, firstItem.width/2, firstItem.height/2);
230+ var firstItemMappedPosition = indicatorsMenu.mapFromItem(firstItem, firstItem.width/2, firstItem.height/2);
231
231
232 // 1) Drag the mouse down to hint a bit
232 // 1) Drag the mouse down to hint a bit
233 touchFlick(indicatorsMenu,
233 touchFlick(indicatorsMenu,
tests/qmltests/Panel/tst_Panel.qml+5−10
@@ -186,11 +186,10 @@ IndicatorTest {
186 for (var i = 0; i < root.originalModelData.length; i++) {
186 for (var i = 0; i < root.originalModelData.length; i++) {
187 var indicatorItem = get_indicator_item(i);
187 var indicatorItem = get_indicator_item(i);
188
188
189− var startXPosition = root.mapFromItem(indicatorItem, indicatorItem.width / 2, 0).x;
189+ var startXPosition = panel.mapFromItem(indicatorItem, indicatorItem.width / 2, 0).x;
190− var startYPosition = root.mapFromItem(panel, 0, 0).y;
191
190
192 touchFlick(panel,
191 touchFlick(panel,
193− startXPosition, startYPosition,
192+ startXPosition, 0,
194 startXPosition, panel.height,
193 startXPosition, panel.height,
195 true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
194 true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
196
195
@@ -244,17 +243,13 @@ IndicatorTest {
244 // (switches between normal and fullscreen modes are animated)
243 // (switches between normal and fullscreen modes are animated)
245 tryCompareFunction(function() { return indicatorArea.y }, data.indicatorY);
244 tryCompareFunction(function() { return indicatorArea.y }, data.indicatorY);
246
245
247− var startXPosition = root.mapFromItem(panel.indicators, panel.indicators.width / 2, 0).x;
248− var startYPosition = root.mapFromItem(panel, 0, panel.height).y;
249−
250 panel.indicators.show();
246 panel.indicators.show();
251 tryCompare(panel.indicators.showAnimation, "running", false);
247 tryCompare(panel.indicators.showAnimation, "running", false);
252 tryCompare(panel.indicators, "unitProgress", 1);
248 tryCompare(panel.indicators, "unitProgress", 1);
253
249
254−
255 touchFlick(panel.indicators,
250 touchFlick(panel.indicators,
256− startXPosition, startYPosition,
251+ panel.indicators.width / 2, panel.height,
257− startXPosition, 0,
252+ panel.indicators.width / 2, 0,
258 true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
253 true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
259
254
260 // Indicators height should follow the drag, and therefore increase accordingly.
255 // Indicators height should follow the drag, and therefore increase accordingly.
@@ -263,7 +258,7 @@ IndicatorTest {
263 function() {return panel.indicators.height <= panel.height * 0.5},
258 function() {return panel.indicators.height <= panel.height * 0.5},
264 true);
259 true);
265
260
266− touchRelease(panel.indicators, startXPosition, 0);
261+ touchRelease(panel.indicators, panel.indicators.width / 2, 0);
267
262
268 tryCompare(panel.indicators.hideAnimation, "running", true);
263 tryCompare(panel.indicators.hideAnimation, "running", true);
269 tryCompare(panel.indicators.hideAnimation, "running", false);
264 tryCompare(panel.indicators.hideAnimation, "running", false);
tests/qmltests/Stages/tst_SpreadDelegate.qml+2−2
@@ -126,9 +126,9 @@ Rectangle {
126 swipeToCloseCheckbox.checked = data.swipeToClose;
126 swipeToCloseCheckbox.checked = data.swipeToClose;
127 closeableCheckbox.checked = data.closeable;
127 closeableCheckbox.checked = data.closeable;
128
128
129− var dragDistance = spreadDelegateLoader.item.height / 2;
129+ var dragDistance = spreadDelegateLoader.item.height * 0.8;
130 var touchX = spreadDelegateLoader.item.width / 2;
130 var touchX = spreadDelegateLoader.item.width / 2;
131− var fromY = spreadDelegateLoader.item.height / 2;
131+ var fromY = spreadDelegateLoader.item.height * 0.9;
132 var toY = fromY - dragDistance;
132 var toY = fromY - dragDistance;
133 touchFlick(spreadDelegateLoader.item,
133 touchFlick(spreadDelegateLoader.item,
134 touchX /* fromX */, fromY, touchX /* toX */, toY,
134 touchX /* fromX */, fromY, touchX /* toX */, toY,
tests/qmltests/tst_Shell.qml+2−2
@@ -501,8 +501,8 @@ Item {
501 // Swipe upwards over the launcher to ensure that this icon
501 // Swipe upwards over the launcher to ensure that this icon
502 // at the bottom is not folded and faded away.
502 // at the bottom is not folded and faded away.
503 var touchStartX = launcherPanel.width / 2;
503 var touchStartX = launcherPanel.width / 2;
504− var touchStartY = launcherPanel.height / 2;
504+ var touchEndY = launcherPanel.height / 2;
505− touchFlick(launcherPanel, touchStartX, touchStartY, touchStartX, 0);
505+ touchFlick(launcherPanel, touchStartX, 0, touchStartX, touchEndY);
506 tryCompare(launcherPanel, "moving", false);
506 tryCompare(launcherPanel, "moving", false);
507
507
508 tap(appIcon, appIcon.width / 2, appIcon.height / 2);
508 tap(appIcon, appIcon.width / 2, appIcon.height / 2);