247
269
clickSpy.wait(200);
272
function test_swipe_on_empty_actions_bug1500416_data() {
274
{tag: "swipe leading, touch", item: emptyActionList, dx: units.gu(5), touch: true},
275
{tag: "swipe trailing, touch", item: emptyActionList, dx: -units.gu(5), touch: true},
276
{tag: "swipe leading, mouse", item: emptyActionList, dx: units.gu(5), touch: false},
277
{tag: "swipe trailing, mouse", item: emptyActionList, dx: -units.gu(5), touch: false}
280
function test_swipe_on_empty_actions_bug1500416(data) {
281
setupSpy(data.item, "contentMovementEnded");
283
tugNoWait(data.item, centerOf(data.item).x, centerOf(data.item).y, data.dx, 0);
285
swipeNoWait(data.item, centerOf(data.item).x, centerOf(data.item).y, data.dx, 0);
287
expectFailContinue(data.tag, "No swipe should happen");
291
function test_swipe_not_possible_when_swipe_disabled_data() {
292
listView.positionViewAtBeginning();
294
{tag: "leading, touch", item: findChild(listView, "listItem0"), dx: units.gu(10), touch: true},
295
{tag: "trailing, touch", item: findChild(listView, "listItem0"), dx: -units.gu(10), touch: true},
296
{tag: "leading, mouse", item: findChild(listView, "listItem0"), dx: units.gu(10), touch: false},
297
{tag: "trailing, mouse", item: findChild(listView, "listItem0"), dx: -units.gu(10), touch: false},
300
function test_swipe_not_possible_when_swipe_disabled(data) {
301
verify(data.item, "test item not found");
302
data.item.swipeEnabled = false;
303
setupSpy(data.item, "contentMovementEnded");
305
tugNoWait(data.item, centerOf(data.item).x, centerOf(data.item).y, data.dx, 0);
307
swipeNoWait(data.item, centerOf(data.item).x, centerOf(data.item).y, data.dx, 0);
309
expectFailContinue(data.tag, "No swipe should happen");
311
data.item.swipeEnabled = true;
314
function test_drag_listitem_content_bug1500409_data() {
316
{tag: "touch", touch: true},
317
{tag: "mouse", touch: false}
320
function test_drag_listitem_content_bug1500409(data) {
321
setupSpy(contentDragging, "contentMovementStarted");
323
TestExtras.touchDrag(0, draggedItem, centerOf(draggedItem), Qt.point(units.gu(10), units.gu(3)));
325
mouseDrag(draggedItem, centerOf(draggedItem).x, centerOf(draggedItem).y, units.gu(10), units.gu(3));
327
expectFailContinue("", "drag disables swipe");