on xenial help sign in
Update tests
commitcb02036badba88a97fb91856982fd0ec32739180 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateTue 25 Nov 2014, 10:53 (12 years ago) parente3a18fd
4 files changed+12−17
tests/qmltests/Panel/tst_IndicatorsMenu.qml+3−3 tests/qmltests/Panel/tst_Panel.qml+5−10 tests/qmltests/Stages/tst_SpreadDelegate.qml+2−2 tests/qmltests/tst_Shell.qml+2−2
tests/qmltests/Panel/tst_IndicatorsMenu.qml+3−3
@@ -174,7 +174,7 @@ IndicatorTest {
174174 // and expose the header
175175 function test_hint() {
176176 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);
178178
179179 touchPress(indicatorsMenu, mappedPosition.x, indicatorsMenu.minimizedPanelHeight / 2);
180180
@@ -195,7 +195,7 @@ IndicatorTest {
195195 for (var i = 0; i < root.originalModelData.length; i++) {
196196 var indicatorItem = get_indicator_item(i);
197197
198− var mappedPosition = root.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
198+ var mappedPosition = indicatorsMenu.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2);
199199
200200 touchFlick(indicatorsMenu,
201201 mappedPosition.x, mappedPosition.y,
@@ -227,7 +227,7 @@ IndicatorTest {
227227
228228 // Get the first indicator
229229 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);
231231
232232 // 1) Drag the mouse down to hint a bit
233233 touchFlick(indicatorsMenu,
tests/qmltests/Panel/tst_Panel.qml+5−10
@@ -186,11 +186,10 @@ IndicatorTest {
186186 for (var i = 0; i < root.originalModelData.length; i++) {
187187 var indicatorItem = get_indicator_item(i);
188188
189− var startXPosition = root.mapFromItem(indicatorItem, indicatorItem.width / 2, 0).x;
190− var startYPosition = root.mapFromItem(panel, 0, 0).y;
189+ var startXPosition = panel.mapFromItem(indicatorItem, indicatorItem.width / 2, 0).x;
191190
192191 touchFlick(panel,
193− startXPosition, startYPosition,
192+ startXPosition, 0,
194193 startXPosition, panel.height,
195194 true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
196195
@@ -244,17 +243,13 @@ IndicatorTest {
244243 // (switches between normal and fullscreen modes are animated)
245244 tryCompareFunction(function() { return indicatorArea.y }, data.indicatorY);
246245
247− var startXPosition = root.mapFromItem(panel.indicators, panel.indicators.width / 2, 0).x;
248− var startYPosition = root.mapFromItem(panel, 0, panel.height).y;
249−
250246 panel.indicators.show();
251247 tryCompare(panel.indicators.showAnimation, "running", false);
252248 tryCompare(panel.indicators, "unitProgress", 1);
253249
254−
255250 touchFlick(panel.indicators,
256− startXPosition, startYPosition,
257− startXPosition, 0,
251+ panel.indicators.width / 2, panel.height,
252+ panel.indicators.width / 2, 0,
258253 true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
259254
260255 // Indicators height should follow the drag, and therefore increase accordingly.
@@ -263,7 +258,7 @@ IndicatorTest {
263258 function() {return panel.indicators.height <= panel.height * 0.5},
264259 true);
265260
266− touchRelease(panel.indicators, startXPosition, 0);
261+ touchRelease(panel.indicators, panel.indicators.width / 2, 0);
267262
268263 tryCompare(panel.indicators.hideAnimation, "running", true);
269264 tryCompare(panel.indicators.hideAnimation, "running", false);
tests/qmltests/Stages/tst_SpreadDelegate.qml+2−2
@@ -126,9 +126,9 @@ Rectangle {
126126 swipeToCloseCheckbox.checked = data.swipeToClose;
127127 closeableCheckbox.checked = data.closeable;
128128
129− var dragDistance = spreadDelegateLoader.item.height / 2;
129+ var dragDistance = spreadDelegateLoader.item.height * 0.8;
130130 var touchX = spreadDelegateLoader.item.width / 2;
131− var fromY = spreadDelegateLoader.item.height / 2;
131+ var fromY = spreadDelegateLoader.item.height * 0.9;
132132 var toY = fromY - dragDistance;
133133 touchFlick(spreadDelegateLoader.item,
134134 touchX /* fromX */, fromY, touchX /* toX */, toY,
tests/qmltests/tst_Shell.qml+2−2
@@ -501,8 +501,8 @@ Item {
501501 // Swipe upwards over the launcher to ensure that this icon
502502 // at the bottom is not folded and faded away.
503503 var touchStartX = launcherPanel.width / 2;
504− var touchStartY = launcherPanel.height / 2;
505− touchFlick(launcherPanel, touchStartX, touchStartY, touchStartX, 0);
504+ var touchEndY = launcherPanel.height / 2;
505+ touchFlick(launcherPanel, touchStartX, 0, touchStartX, touchEndY);
506506 tryCompare(launcherPanel, "moving", false);
507507
508508 tap(appIcon, appIcon.width / 2, appIcon.height / 2);