on xenial help sign in
A bit of refactoring
commit0af68ffd59f6041872e7df77baae6eb6c48270b4 authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 12 Mar 2015, 17:08 (12 years ago) parent8fff1dd
3 files changed+7−4
tests/qmltests/Dash/Previews/tst_Preview.qml+1−1 tests/qmltests/Dash/tst_Dash.qml+1−1 tests/utils/modules/Unity/Test/UnityTestCase.qml+5−2
tests/qmltests/Dash/Previews/tst_Preview.qml+1−1
@@ -113,7 +113,7 @@ Rectangle {
113113
114114 // Scroll down
115115 var previewListRow0 = findChild(preview, "previewListRow0");
116− tryTouchFlickToYEnd(previewListRow0, previewListRow0.width / 2, units.gu(20), previewListRow0.width / 2, units.gu(1));
116+ flickToYEnd(previewListRow0);
117117
118118 // Click on the combo
119119 var widget = findChild(preview, "widget-21");
tests/qmltests/Dash/tst_Dash.qml+1−1
@@ -497,7 +497,7 @@ Item {
497497 tryCompare(subPageLoader, "x", 0);
498498 tryCompare(findChild(dashTempScopeItem, "categoryListView"), "visible", false);
499499 var previewListRow0 = findChild(subPageLoader, "previewListRow0");
500− tryTouchFlickToYEnd(previewListRow0, previewListRow0.width / 2, units.gu(20), previewListRow0.width / 2, units.gu(1));
500+ flickToYEnd(previewListRow0);
501501 var widget = findChild(subPageLoader, "widget-21");
502502 var initialWidgetHeight = widget.height;
503503 var openButton = findChild(widget, "buttonopen_click");
tests/utils/modules/Unity/Test/UnityTestCase.qml+5−2
@@ -221,10 +221,13 @@ TestCase {
221221 }
222222 }
223223
224− function tryTouchFlickToYEnd(item, x, y, toX, toY) {
224+ function flickToYEnd(item) {
225225 var i = 0;
226+ var x = item.width / 2;
227+ var y = item.height - units.gu(1);
228+ var toY = units.gu(1);
226229 while (i < 5 && !item.atYEnd) {
227− touchFlick(item, x, y, toX, toY);
230+ touchFlick(item, x, y, x, toY);
228231 tryCompare(item, "moving", false);
229232 ++i;
230233 }