on xenial help sign in
Use timeStep as delay time
2e631ceAlbert Astals Cid
tests/qmltests/Dash/tst_Dash.qml+4−3
@@ -310,8 +310,9 @@ Item {
310 var stopX = units.gu(1)
310 var stopX = units.gu(1)
311 var stopY = startY;
311 var stopY = startY;
312 waitForRendering(dashContentList)
312 waitForRendering(dashContentList)
313− mouseFlick(dash, startX, startY, stopX, stopY);
313+ mouseFlick(dash, startX, startY, stopX, stopY, true, true, units.gu(200));
314+ compare(dashContentList.currentIndex, 1, "Could not flick to scope id 1");
314− mouseFlick(dash, startX, startY, stopX, stopY);
315+ mouseFlick(dash, startX, startY, stopX, stopY, units.gu(200));
315 compare(dashContentList.currentIndex, 2, "Could not flick to scope id 2");
316 compare(dashContentList.currentIndex, 2, "Could not flick to scope id 2");
316 var dashCommunicatorService = findInvisibleChild(dash, "dashCommunicatorService");
317 var dashCommunicatorService = findInvisibleChild(dash, "dashCommunicatorService");
317 dashCommunicatorService.mockSetCurrentScope(0, true, false);
318 dashCommunicatorService.mockSetCurrentScope(0, true, false);
@@ -411,7 +412,7 @@ Item {
411 compare(dashContentList.currentItem.scopeId, "clickscope");
412 compare(dashContentList.currentItem.scopeId, "clickscope");
412
413
413 // Move to second scope
414 // Move to second scope
414− mouseFlick(dash, dash.width / 2, units.gu(2), dash.width / 5, units.gu(2));
415+ mouseFlick(dash, dash.width / 2, units.gu(2), dash.width / 5, units.gu(2), true, true, units.gu(20));
415 tryCompare(dashContentList, "currentIndex", 1);
416 tryCompare(dashContentList, "currentIndex", 1);
416 compare(dashContentList.currentItem.scopeId, "MockScope1");
417 compare(dashContentList.currentItem.scopeId, "MockScope1");
417 }
418 }
tests/qmltests/Launcher/tst_Launcher.qml+3−3
@@ -824,7 +824,7 @@ Rectangle {
824
824
825 // Dragging a bit (> 1.5 gu)
825 // Dragging a bit (> 1.5 gu)
826 newMouseX -= units.gu(2)
826 newMouseX -= units.gu(2)
827− mouseFlick(launcher, currentMouseX, currentMouseY, newMouseX, newMouseY, false, false, 100)
827+ mouseFlick(launcher, currentMouseX, currentMouseY, newMouseX, newMouseY, false, false)
828 currentMouseX = newMouseX
828 currentMouseX = newMouseX
829
829
830 // Other items need to expand and become 0.6 opaque
830 // Other items need to expand and become 0.6 opaque
@@ -832,8 +832,8 @@ Rectangle {
832 tryCompare(item0, "itemOpacity", 0.6)
832 tryCompare(item0, "itemOpacity", 0.6)
833
833
834 // Dragging a bit more
834 // Dragging a bit more
835− newMouseY += initialItemHeight * 1.5
835+ newMouseY += initialItemHeight * 1.25
836− mouseFlick(launcher, currentMouseX, currentMouseY, newMouseX, newMouseY, false, false, 100)
836+ mouseFlick(launcher, currentMouseX, currentMouseY, newMouseX, newMouseY, false, false)
837 currentMouseY = newMouseY
837 currentMouseY = newMouseY
838
838
839 tryCompare(findChild(draggedItem, "dropIndicator"), "opacity", 1)
839 tryCompare(findChild(draggedItem, "dropIndicator"), "opacity", 1)
tests/utils/modules/Unity/Test/UnityTestCase.qml+4−4
@@ -163,9 +163,9 @@ TestCase {
163 if (i === iterations - 1) {
163 if (i === iterations - 1) {
164 // Avoid any rounding errors by making the last move be at precisely
164 // Avoid any rounding errors by making the last move be at precisely
165 // the point specified
165 // the point specified
166− mouseMove(item, toX, toY, iterations / speed)
166+ mouseMove(item, toX, toY, timeStep)
167 } else {
167 } else {
168− mouseMove(item, x + (i + 1) * diffX, y + (i + 1) * diffY, iterations / speed)
168+ mouseMove(item, x + (i + 1) * diffX, y + (i + 1) * diffY, timeStep)
169 }
169 }
170 }
170 }
171 if (releaseMouse) {
171 if (releaseMouse) {
@@ -346,12 +346,12 @@ TestCase {
346 if (i === iterations - 1) {
346 if (i === iterations - 1) {
347 // Avoid any rounding errors by making the last move be at precisely
347 // Avoid any rounding errors by making the last move be at precisely
348 // the point specified
348 // the point specified
349− wait(iterations / speed)
349+ wait(timeStep)
350 var event = touchEvent(item)
350 var event = touchEvent(item)
351 event.move(0 /* touchId */, rootTo.x, rootTo.y)
351 event.move(0 /* touchId */, rootTo.x, rootTo.y)
352 event.commit()
352 event.commit()
353 } else {
353 } else {
354− wait(iterations / speed)
354+ wait(timeStep)
355 var event = touchEvent(item)
355 var event = touchEvent(item)
356 event.move(0 /* touchId */, rootFrom.x + (i + 1) * diffX, rootFrom.y + (i + 1) * diffY)
356 event.move(0 /* touchId */, rootFrom.x + (i + 1) * diffX, rootFrom.y + (i + 1) * diffY)
357 event.commit()
357 event.commit()